What is the role of the Docker Client in Docker architecture?
The Docker Client is the user interface that accepts commands from users and sends them to the Docker Daemon to execute. It acts like a remote control for Docker.
Click to reveal answer
beginner
Explain the Docker Daemon and its function.
The Docker Daemon runs on the host machine and manages Docker objects like containers, images, networks, and volumes. It listens for commands from the Docker Client and performs the requested actions.
Click to reveal answer
beginner
What is a Docker Registry and why is it important?
A Docker Registry is a storage and distribution system for Docker images. It allows users to share and download images. Docker Hub is a popular public registry.
Click to reveal answer
intermediate
How do the Docker Client and Docker Daemon communicate?
They communicate through REST API calls over a socket or network interface. The client sends commands, and the daemon executes them.
Click to reveal answer
intermediate
Describe the flow when you run 'docker run' command.
The Docker Client sends the 'run' command to the Docker Daemon. The daemon checks if the image exists locally or pulls it from the Registry. Then it creates and starts the container.
Click to reveal answer
Which component in Docker architecture listens for commands and manages containers?
ADocker Daemon
BDocker Client
CDocker Registry
DDocker Compose
✗ Incorrect
The Docker Daemon listens for commands from the client and manages containers and other Docker objects.
Where are Docker images stored for sharing and downloading?
ADockerfile
BDocker Daemon
CDocker Client
DDocker Registry
✗ Incorrect
Docker Registry stores Docker images so users can share and download them.
How does the Docker Client communicate with the Docker Daemon?
ADirect file access
BThrough REST API calls
CUsing SSH only
DVia Docker Registry
✗ Incorrect
The Docker Client sends commands to the Docker Daemon using REST API calls over a socket or network.
What happens if the Docker Daemon does not find an image locally when running a container?
AIt pulls the image from the Docker Registry
BIt asks the Docker Client to build the image
CIt throws an error and stops
DIt creates a new image automatically
✗ Incorrect
The Docker Daemon pulls the image from the Docker Registry if it is not found locally.
Which of these is NOT part of Docker architecture?
ADocker Client
BDocker Daemon
CDocker Kernel
DDocker Registry
✗ Incorrect
Docker Kernel is not a component; Docker uses the host OS kernel but does not have its own kernel.
Describe the roles of Docker Client, Docker Daemon, and Docker Registry in Docker architecture.
Think about who talks, who does the work, and where images are kept.
You got /3 concepts.
Explain the process that happens when you run a Docker container using 'docker run'.
Follow the command from user input to container start.
You got /4 concepts.
Practice
(1/5)
1. Which component of Docker architecture is responsible for sending commands to manage containers?
easy
A. Docker Registry
B. Docker Daemon
C. Docker Client
D. Docker Image
Solution
Step 1: Understand the role of Docker Client
The Docker Client is the tool users interact with to send commands like docker run or docker build.
Step 2: Differentiate from Daemon and Registry
The Daemon executes commands, and the Registry stores images, but only the Client sends commands.
2. Which of the following commands correctly starts the Docker daemon on a Linux system?
easy
A. systemctl start docker
B. service docker-client start
C. docker daemon run
D. docker start daemon
Solution
Step 1: Identify the correct system command to start Docker daemon
On Linux, the Docker daemon is managed by systemd and started with systemctl start docker.
Step 2: Eliminate incorrect commands
docker start daemon and docker daemon run are invalid Docker commands. service docker-client start is incorrect because the daemon is called 'docker', not 'docker-client'.
Final Answer:
systemctl start docker -> Option A
Quick Check:
Use systemctl to start Docker daemon = D [OK]
Hint: Use systemctl to manage Docker daemon on Linux [OK]
Common Mistakes:
Using docker commands to start daemon directly
Confusing client and daemon service names
Using service command with wrong service name
3. What will happen when you run docker pull nginx if the image is not present locally?
medium
A. The command fails because image is missing
B. Docker Client builds the image locally
C. Docker Registry sends the image to the Client directly
D. Docker Daemon downloads the image from Docker Registry
Solution
Step 1: Understand the pull command flow
When docker pull nginx is run, the Client sends the request to the Daemon.
Step 2: Role of Daemon and Registry
The Daemon downloads the image from the Registry and stores it locally. The Client does not build the image, and the Registry does not send images directly to Client.
Final Answer:
Docker Daemon downloads the image from Docker Registry -> Option D
Quick Check:
Pull downloads image via Daemon from Registry = A [OK]
Hint: Pull triggers daemon to fetch image from registry [OK]
Common Mistakes:
Thinking Client builds image on pull
Assuming Registry sends image directly to Client
Believing pull fails if image missing locally
4. You run docker run hello-world but get an error saying the Docker daemon is not running. What is the most likely fix?
medium
A. Restart the Docker Client
B. Start the Docker Daemon service
C. Pull the image manually from the Registry
D. Reinstall Docker Registry
Solution
Step 1: Identify the error cause
The error indicates the Docker Daemon is not running, so commands cannot be executed.
Step 2: Fix by starting the Daemon
Starting the Docker Daemon service (e.g., systemctl start docker) will fix the issue. Restarting Client or pulling image manually won't help if Daemon is down.
Final Answer:
Start the Docker Daemon service -> Option B
Quick Check:
Daemon must run for commands to work = A [OK]
Hint: Daemon must be running to execute Docker commands [OK]
Common Mistakes:
Restarting Client instead of Daemon
Trying to pull image without Daemon running
Reinstalling Registry unnecessarily
5. You want to push a custom image to a private Docker Registry. Which sequence correctly describes the interaction between Docker components?