Q) What is Docker Hub?
Docker Hub is cloud based registry service that stores container images. It allows us to pull and push docker images to and from Docker Hub. It stores both types of repositories, i.e., pubic repository as well as the private repository.
Docker Hub is central repository for container image discovery, distribution, change management, workflow automation and team collaboration.
Compose is a tool for defining and running multi-container Docker applications. Docker Compose is a YAML file that contains details about the services, networks, and volumes for setting up the Docker application. So, you can use Docker Compose to create separate containers, host them, and get them to communicate with each other. Each container will expose a port for communicating with other containers.
docker stack is a command that's embedded into the Docker CLI. It lets you manage a cluster of Docker containers through Docker Swarm.
1. Services: Service defines a task that needs to be executed on the manager or worker node.
2. Tasks: Tasks are the Docker container that executes the commands you define in service.
3. Manager Node: The manager node has a few responsibilities like accepting commands to create service objects, allocating the IP addresses to the various tasks, and assigning the tasks to the nodes.
4. Worker Node: It is responsible for checking the tasks assigned and also executing the containers.
Ref Link: https://intellipaat.com/community/41375/what-are-the-components-of-docker-swarm
Q) The correct order of service
creation process in swarm mode?
Manager Node:
Ø
Docker
API: Accepts command from the client and creates service object.
Ø
Orchestrator:
Reconciliation loop for service objects and creates tasks.
Ø
Allocator:
Allocates IP address to tasks.
Ø
Scheduler:
Assigns nodes to tasks.
Ø
Dispatcher:
Checks in on workers.
Worker Node:
Ø
Worker:
Connects to the dispatcher to check on assigned tasks.
Ø
Executor:
Executes the tasks assigned to the worker node.
Q)
What are the various states that a Docker container can be in at any given
point in time?
There are six states that a Docker container can be in, at any given point in time. Those states are as given as
follows:
Ø
Created
Ø
Restarting
Ø
Running
Ø
Paused
Ø
Exited
Ø
Dead
Ref Link: https://roytuts.com/what-are-the-possible-states-of-docker-container/
Basically, an application that is being developed and deployed is bundled and wrapped together with all its configuration files and dependencies. This bundle is called a container. Containerization is the process of packaging application code with its required libraries, frameworks, and configuration files so that it can be run efficiently and seamlessly in any environment.
The containerization environments are Docker and Kubernetes.
Some of the common instructions in Dockerfile are as follows:
ØFROM: We use FROM to set the base image for subsequent instructions. In every valid Dockerfile, FROM is the first instruction.
ØLABEL: We use LABEL to organize our images as per project, module, licensing etc. We can also use LABEL to help in automation. In LABEL we specify a key-value pair that can be later used for programmatically handling the Dockerfile
ØRUN: We use RUN command to execute any instructions in a new layer on top of the current image. With each RUN command we add something on top of the image and use it in subsequent steps in Dockerfile.
ØCMD: We use CMD command to provide default values of an executing container. In a Dockerfile, if we include multiple CMD commands, then only the last instruction is used.
Q)
Docker Universal Control Plane.
Q) Difference between replicated and global deployment?
For a replicated service, you specify the number of identical tasks you want to run. For example, you decide to deploy a Redis service with five replicas, each serving the same content. A global service is a service that runs one task on every node. There is no pre-specified number of tasks.
1. Volume mount: it is managed by docker and is stored in a part of the host filesystem (stored at /var/lib/docker/volumes/ in Linux).
2. Bind mount: it may be stored anywhere on the host system.
3. tmpfs: Stored only in a host’s system memory in Linux.
Q)
Difference between docker stop and docker kill?
#docker stop <container-id>: will
send SIGTERM (terminate) signal and then SIGKILL signal after a grace period of
10 secs to the process running inside the container leading to a gracefull stop.
#docker kill <container-id>: will
send SIGKILL signal to the process running inside the container causing abruptly
stop the container.







































