DEV Community

Cover image for Why use Docker
Karlgusta Esimit
Karlgusta Esimit

Posted on

Why use Docker

Docker allows us to track multiple versions of our app. Just as we use Git to track multiple versions of code.

It is like having a rewind button for our app, so that we can go back if something goes wrong.

How does Docker work?

There are two important things in Docker:

  • Images
  • Containers

Entire workflows revolve around them.

Images are like a food recipe.

Image description

You see how you can have a recipe with all the ingredients and instructions such that a new person can cook the same meal, that is what Docker does.

It has all of our code, libraries, runtime environments, system tools and even the operating system.

Now, the container takes the image and executes everything. You don't have to run the commands. The container does that for you.

The npm create react app, downloading and all those commands. The container does that for you so that your application can run.

Containers is the final cake. The baked thing.

Image description

And as we can have many cakes from the same recipe, we can have multiple containers from the same image. That is the beauty of Docker.

We can create one image and have many instances in the form of containers.

Top comments (0)