Understanding Docker the Easy Way

How many of you guys have wondered what goes on behind these machines we use on a daily basis? What is causing all the software to run? What do the large tech giants use in order to sustain a fully operational web-application? Well, the answer is Container using Docker. There are many other aspects that are running in the background, such as Kubernetes, Cloud Computing, and many more, however, I will be focusing on Docker and helping you to understand how Docker run containers in the background.

What is Docker?

Before going on into the technical details, it is important to understand the importance of Docker and the general idea behind Docker. In essence, Docker is an easy way to run a user’s application and deploy it in a loose environment, known as a container. It takes away the pressure from the user to manually deploy the application and allows for a semi-autonomous solution to this. This replaces the use of virtual machines as the containers include of many more features. Containers help in packaging up all the code and all other aspects and runs quickly and reliably on a computing environment.

Containers vs Virtual Machines:

A diagram of Container and VM Architecture

You may be wondering “What is the difference between VM’s and Containers”? Before answering that, we have to go over VMs and what they are. In summary, VMs, or virtual machines, allow users to run applications and operating systems right from their desktop and behaves like a separate computer. However, everything is not automated and must be managed by the user. So, onto the differences. One of the main differences that can be seen, based on the architecture, is that with containers, all of the applications run the same OS and have a container image. This allows for the OS to remain the same and other software can be installed on top of that. However, when looking at the VMs, each application has its own OS and this can become a hassle when many application use the same exact OS. In addition, you will see that the VMs are running in a hypervisor, which helps in executing and running the entire VM. Because of this burden, it takes up the most resources. But, when looking at the use-case, each have their own benefits. If your application is going to require heavyweight, different Operating Systems, and utilizes hardware, VMs would be the best way to go. If your application requires lightweight, shared Operating Systems, and OS utilization, containers would be the way to go.

Getting Started with Docker

Your next question may revolve around getting started with Docker and don’t worry, it’s time to go over that. There are somethings that must be done before. Firstly, you must create a Docker Hub account. This account will allow your terminal to get images from the hub site and will operate the container. Use this link to get started at Docker Hub:

Next, you must install Docker on your console/terminal. A command will be used in order to install all of the main components needed to create Docker container, including the Docker CLI commands. That command for MAC is:

brew install docker

Finally, you will need to install the Docker Application on your PC. This application will allow your desktop to run Docker and will run the Docker Deamonset which is a necessary component needed in order to run the container. This, however, is not installed by the last command so you will have to do this manually. Use this link to download it:

You are done!

You are done with the set-up. You now have all the fundamental knowledge of Docker and have set-up your pc to create containers. Now is the time to create your container. This is getting a bit too long so I will cover this in my next blog. I hope you have retained some valuable information in regards to Docker and see you in the next blog!

Senior at Rick Reedy High School and aspiring Data Scientist; Writer for Better Programming.