What Are Docker Containers And Why Use Them

Reading Time: 2 minutes

In this blog I’ll talk briefly about Docker. People usually compare it to virtual machines, which is not really a fair comparison. Virtual machines are used to solve the problem of compatibility, for example if your code runs on your machine but doesn’t run on another developer’s machine because you’re basically working on a different environment. Docker however runs as a container and sits on top of virtual machines.

What Does Docker Do, and When Should You Use It? – CloudSavvy IT

Docker Images

Your project code contains a small file called Dockerfile which builds an image, this image contains all your project code and any installments of programs that you need to run your application. This image is basically where your whole application is wrapped up and it sits on top of a virtual machine.

Docker Containers

From the image you just built, you can run as many containers as you want till you run out of ram. Fore example, run centos. First, you’ll need to pull the image using docker pull centos which is going to dockerhub and finds it. Now lets run it using docker run -d -t –name myContainer centos. You can use the command docker -ps to see your running containers and you can add -a to see all the containers.

What is a Container? | App Containerization | Docker

Why Containers?

Containers are so fast because you simply need one kernel, kernel if your computer is using Linux, all the containers you are running share the underline Linux kernel. You can also say they are so lightweight for the same reason, you don’t need more than one kernel for them to run


with Docker you can actually build your environment instead of putting your project code into an environment, and you can run it anywhere knowing its going to work no matter what operating system or environment the other developer is using. The only requirement is that the other developer has docker installed on his machine.


[1] https://www.cloudsavvyit.com/490/what-does-docker-do-and-when-should-you-use-it/

[2] https://www.docker.com/resources/what-container


Leave a Reply