Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
October 18, 2021 08:48 am GMT

Docker for Dummies

So, what is Docker? The Docker Engine is a virtualization platform and service that deploys and runs apps in containers. That's a common, concise, and yet very esoteric description. In order to try and explain this description of Docker, some basics of how a program is installed and run must first be covered.

Generally, whether the operating system on a host machine is Windows, MacOS, or Linux, when the user needs to use a certain app or software they must first download and install that app. There are many ways to do this, but the most simple and common way is to download the app directly to your hard drive. The installation process is slightly different depending on the operating system, but installing it will put the main program in your operating system's directory for programs, and a bunch of other supporting files throughout your entire file system. To run an app in this simple setup, the operating system then dedicates specified amounts of resources like RAM, CPU, and additional hard drive space. For all the above processes to work, the installer or package manager must know which files must go where, and the app itself must be able to communicate directly to the operating system. The more accessible a development team wants their app to be, the more operating systems they have to program for. The more operating systems they program for, the more file systems they have to account for. To deal with this growing complexity in both the development and deployment of the app, virtualization can be used.

Virtual Machine Diagram

With a traditional Virtual Machine, an app can be written for use in one operating system but used on a host machine that has a different operating system installed and running. For example, a machine running Windows can run a program that needs to run in a Linux operating system by using a hypervisor like WSL to translate between the two operating systems. Additional Virtual Machines can be generated for how many different types of operating systems that are needed. Unfortunately, this has downsides as each additional Virtual Machine is a whole new operating system that uses redundant files and each app has to get two operating systems to agree on how much resources it can be allocated.

Docker Platform and Containers

This is where Docker and its containers comes in. Containers are environments in the Docker Engine where the app and all its supporting files resides all in one place. The Docker Engine also talks directly to the host machine's operating system to allocate a fixed amount of resources to each container. The main benefit of the fixed resource allocation is stability as the app should always have enough; the downside is that if it is allocated too much, those resources will be wasted and unusable by the host machine.

It should be noted that Docker is run natively in Linux. When run on a Linux operating system, Docker can talk directly to the kernel in resource requests. This direct connection saves additional resources and time. When Docker is run on MacOS or Windows, it is run much like a Virtual Machine in that the Docker Engine must talk to a hypervisor first.

The Office meme

In summary, because everything the apps need are in the containers, docker simplifies many of the processes to develop and deploy said apps. The apps should be more stable since it has a fixed amount of resources reserved for it. Using Docker on a Linux machine can save additional resources by not having to use a hypervisor.

References:
Docker -
https://www.docker.com/
https://docs.docker.com/

Wikipedia -
https://en.wikipedia.org/wiki/Docker_(software)

Additional Links:
Docker - Command Line Interface documentation
https://docs.docker.com/engine/reference/commandline/cli/

When not to use Docker -
https://www.freecodecamp.org/news/7-cases-when-not-to-use-docker/


Original Link: https://dev.to/sdronin/docker-for-dummies-55bm

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To