Table of contents
So far, we've looked at why we need Docker and containerization, as well as what microservices are. But the question still remains: what exactly is a container?
Container
A container is like a box in which you put all your code and other configurations and then ship it in the form of Docker image to the image hub or image registry, like Docker Hub.
Others can download that image and use Docker to run your code without installing anything. Docker will handle the installation and other configurations. But for that, you should have Docker installed on your PC.
You might be wondering what Docker Image is and how it differs from "Container."
Let's find out.
Docker Images
You can recall Docker images as classes from object-oriented programming, which are templates to build objects. Same here: images work as templates to create containers. It is basically an immutable snapshot of the container.
You can create Docker images using docker build
command, and when you run docker run
command, it will run a container of that image. You can create multiple containers from the same image.
You can pull images from Docker Hub(An online docker image registry) using docker pull
command.
Docker Installation ๐งโ๐ง
You can install Docker on all available operating systems.
Resources ๐
So that was all about Docker images and Docker containers. Stay tuned for more such blogs.