0
0
Dockerdevops~20 mins

What is Docker - Practice Questions & Exercises

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Docker Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the primary purpose of Docker?

Docker is a popular tool in DevOps. What is its main purpose?

ATo create isolated environments called containers to run applications consistently.
BTo manage virtual machines with heavy resource usage.
CTo monitor network traffic between servers.
DTo write code in multiple programming languages.
Attempts:
2 left
💡 Hint

Think about how Docker helps developers run apps the same way everywhere.

💻 Command Output
intermediate
1:30remaining
What is the output of 'docker ps' command?

After running docker ps on a system with two running containers, what will you see?

Docker
docker ps
AA list showing details of all running containers including container ID, image, status, and ports.
BA list of all images downloaded on the system.
CA list of all stopped containers only.
DAn error saying 'command not found'.
Attempts:
2 left
💡 Hint

Remember, docker ps shows running containers, not images or stopped containers.

Configuration
advanced
2:00remaining
Which Dockerfile instruction sets the base image?

In a Dockerfile, which instruction is used to specify the base image for your container?

Docker
Dockerfile snippet
ACMD python app.py
BRUN apt-get update
CCOPY . /app
DFROM ubuntu:20.04
Attempts:
2 left
💡 Hint

The base image is the starting point for your container's environment.

🔀 Workflow
advanced
2:30remaining
What is the correct order to build and run a Docker container?

Arrange these steps in the correct order to build and run a Docker container from a Dockerfile.

A3,2,1,4
B3,1,2,4
C1,3,2,4
D2,1,3,4
Attempts:
2 left
💡 Hint

First create the Dockerfile, then build the image, run the container, and finally check it.

Troubleshoot
expert
2:00remaining
What error occurs if Docker daemon is not running when executing 'docker ps'?

You run docker ps but get an error. What is the most likely error message if the Docker daemon is not running?

AError: No such container found.
BSyntax error near unexpected token 'ps'.
CCannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
DPermission denied while accessing Dockerfile.
Attempts:
2 left
💡 Hint

Think about what happens if the Docker service is stopped but you try to use Docker commands.