There is an application. We take this application and dockerize it, which means we make a small change so that it can be run by Docker.

How? We just add a docker file to it. A docker file is a plain text file that includes instructions that docker uses to package up this application into an image. This image contains everything our application needs to run.

Image:

  • A cut-down OS
  • A runtime environment
  • Application files
  • Third-party libraries
  • Environment variables

So, we create a docker file and give it to docker for packaging our application into an image.

Once we have an image, we tell docker to start a container using that image. So a container is just a process. But it’s a special kind of process because it has its own file system which is provided by the image.

So, our application gets loaded inside a container or a process. And this is how we run our application locally on our development machine.

Instead of directly launching the application and running it inside a typical process, we tell docker to run it inside a container, an isolated environment.

Here is the beauty of Docker.

Once we have this image, we can push it to a Docker Registry, like Docker Hub. Docker hub to Docker is like github to git. It’s a storage for docker images that anyone can use. So once our application image is on Docker Hub, then we can put it on any machines running Docker. This machine has the same image we have on our development machine, which contains a specific version of our application with everything it needs. So we can start the application the same way we started on our development machine. We just tell Docker to start a container using this image.

So, with Docker, we no longer need to maintain long complex release documents that has to be precisely followed. All the instructions for building an image of an application are written in a Docker File. With that we can package our application into an Image and run it virtually anywhere. This is the beauty of Docker.


0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published. Required fields are marked *