Docker: Containing developers multi-environment headaches
What is a “Docker container”?
A Docker container is similar to a virtual machine that is composed of the various applications necessary to run a system. Included in the container are things like web applications, web servers, databases and any other things necessary to run the system which normally would exist in different environments and be very difficult to stitch together to produce a functioning system. Docker allows these varied applications to be contained within “Docker images” which can be shared on the “Docker registry” and easily be pieced together to create a functioning “Docker container”.
Docker’s Build, Ship and Run steps to create a functioning system on a Docker container are as follows:
- Build the blocks for your system
Write code, develop applications and combine them all together to create Docker images that are the building blocks for your system
- Ship out your Docker images to the Docker registry
Share the Docker images on the Docker registry so they can be used by yourself and others in building functional Docker containers
- Run your Docker container wherever you like
Combine the registered Docker images to create a functional Docker container that can run on-premise or on the cloud
What are the benefits of using a Docker container versus a virtual machine?
While the explanation of a Docker container may seem convoluted, the benefits are extensive when compared to building virtual machines. Docker contains the writing and testing of code in the same environment where it will be deployed, as well as providing the environment for servers, databases and other applications. Containing all these separate applications saves time and computing power, resulting in large reductions in the total cost of operation.
Where a virtual machine would require its own OS, Docker does not require an OS and only contains the package of components necessary to run your software. These containers are easily manipulated and can be run from various on-premise sites or more and more commonly, on the cloud to be easily remotely accessed. To finish the post, I will reference the comparison between software containers and shipping containers that inspired Docker containers name.
Before shipping containers, varied goods were shipped in varied amounts on boats and the process was very complicated and inefficient. Space was wasted and more boats were needed to transport goods. By introducing shipping containers, a multitude of goods could be shipped efficiently by placing various containers on a single boat. Similarly Docker allows for many things to be placed in a single ‘boat’ or container that would have otherwise required many boats. The resulting efficiency has helped developers automate their machines and speed up development leading to the goal of continuous deployment known as DevOps, the next topic in my four part series.
Hope you enjoyed my article and apologies for my laymens knowledge and any confusion resulting therein!
*Originally posted on July 12, 2016