Architecture of Docker - Docker Ecosystem

Architecture of Docker - Docker Ecosystem

Architecture of Docker

Consider the following diagram

No alt text provided for this image

Developer will write the Docker file to create container. This file contains all things required in a container. For example, there should be Ubuntu, GIT, and CHEF in container. All these requirements will be written in this Docker file. It is very easy to write the docker file. This Docker file will run on docker engine and image will be created the moment you run your docker file. Docker engine will keep one copy of image with it. So it may offer same thing next time with less time. From this image, container will be created with all specifications mentioned in docker file. You can place this image on docker hub so other may use this image too as per their requirements. Container is a layered file system.

Docker Ecosystem

Docker eco system is a set of software or packages required to build container. It includes

1.      Docker daemon

2.      Docker client

3.      Docker hub

4.      Docker images

5. Docker host  

No alt text provided for this image

Docker daemon/server/engine runs on the host OS. It is responsible for running containers and manages docker services. Docker daemon can communicate with other daemons. It converts your image into container.

Docker Client – Docker user can interact with Docker daemon/server through a client. Docker client uses commands and Rest API to communicate with the Docker daemon. When a client runs any server command on the Docker client terminal, the client terminal sends these Dockers commands to the Docker daemon. It is possible for Docker client to communicate with more than 1 daemon.

Docker Host – provides an environment to execute and run applications. It contains docker daemon, images, containers, networks and storages.

Docker Hub/Registry – Docker registry/hub manages (keeps images category wise) and stores Docker images. There are two types of registries in the Docker.

1.      Public Registry – is also called as Docker hub. It is accessible for everyone.

2.      Private Registry – is used to share images within the enterprise

Docker Images – are the read only binary templates used to create Docker containers

Ways to create an image

 There are 3 ways to create image

1.      Take image from Docker hub

2.      Create image from Docker file

3.      Create image from existing Docker container

Docker Container – Holds entire packages needed to run application or in other words, we can say that, the image is a template and the container is a running form of that template. Container is like a virtual machine. Images become container when they are run on Docker engine.

No alt text provided for this image

Dockerfile

Dockerfile is basically a text file containing some set of instructions (OS, software and files). Point to ponder is, name of the file will always be “Dockerfile”. It automates Docker image creation. You can edit a file unlimited number of time and create image as per your requirement. All instructions written in Dockerfile are in capital letters. These are given below.

Dockerfile components

Dockerfile components are basically set of instructions used in file. Some important Dockerfile instructions are given below.

No alt text provided for this image

Creating container from a Dockerfile

Follow these steps to create a container from Dockerfile

1.      Create a file named Dockerfile

2.      Add instructions in file

3.      Build Dockerfile to create image

4.      Run image to create a container




To view or add a comment, sign in

Insights from the community

Explore topics