Question:- How to run a Docker image?
Answer:- he ‘docker run’ command runs an image inside the container. It will require the image name. docker run [docker_image]
Question:- How to start a Docker container?
Answer:- The following command starts a Docker container: docker container start [OPTIONS] CONTAINER [CONTAINER...]
Question:- How to use Docker Compose?
Answer:- Docker Compose typically includes a three-step process: 1. Using a dockerfile to define the app’s environment to facilitate reproduction anywhere 2. Defining the app services in docker-compose.yml so that they can run in an isolated environment together 3. Running docker-compose up
Question:- What command should be run to view all the running Docker containers?
Answer:- To view all the running containers in Docker, we can use the following: $ docker ps
Question:- What is Docker daemon?
Answer:- Docker daemon is a service that manages Docker containers, images, storage volumes, and the network. It constantly listens to Docker API requests and processes them. A daemon can communicate with other daemons as well for the management of Docker services.
Question:- Name and explain the states of a Docker container.
Answer:- • Created: We see this Docker container state when a container is newly created. • Restarting: When the Docker container is restarted due to any issues, this state is observed. • Running: It is the main state for the container after it has started. • Paused: When a running Docker container is temporarily stopped via docker pause, this is the status that we will see. • Exited: If a container has stopped due to some issue or stopped manually, this will be the state of the container. • Dead: When the daemon has tried but failed to stop a container (mostly because of a busy device or resource), this state will be seen.
Question:- What is Docker Hub?
Answer:- Docker Hub helps with linking to code repositories. This cloud-based registry enables the building, testing, and storing of images in Docker Cloud. Images can also be deployed to the host with it.
Question:- Define Virtualization.
Answer:- Virtualization is the process of logically dividing mainframes to enable more than one application to run at a time.
Question:- What is a Hypervisor?
Answer:- A hypervisor helps in the creation of a virtual environment, in which the guest virtual machines run. It manages the guest systems and checks the required resource allocations to the guests.
Question:- What are Docker object labels?
Answer:- Docker object labels help us add metadata to Docker objects, including containers, images, Swarm nodes, network, volumes, and services.
Question:- What are the steps in a Docker container life cycle?
Answer:- • Build • Pull • Run
Question:- Name the three components of the Docker architecture.
Answer:- • Client • Docker host • Registry
Question:- How do you scale your Docker containers?
Answer:- Docker containers can be scaled to any level, starting from a few hundreds to even thousands or millions of containers. The only condition is that the containers need the memory and the OS all the time, and there should not be a constraint on these when the Docker is getting scaled.
Question:- How does communication happen between Docker client and Docker daemon?
Answer:- The communication between Docker client and Docker daemon happens with the help of the combination of TCP, Rest API, and Socket.IO.