Bird
Raised Fist0
Dockerdevops~20 mins

Docker engine and runtime - Practice Problems & Coding Challenges

Choose your learning style10 modes available
Challenge - 5 Problems
🎖️
Docker Engine Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
1:30remaining
Identify Docker Engine Version Output
What is the output of the command docker version --format '{{.Server.Version}}' when Docker Engine version 24.0.2 is installed?
Docker
docker version --format '{{.Server.Version}}'
A24.0.2
BClient: 24.0.2
CVersion: 24.0.2
DDocker Engine 24.0.2
Attempts:
2 left
💡 Hint
The --format option outputs only the specified field without extra text.
🧠 Conceptual
intermediate
1:30remaining
Docker Runtime Default Behavior
Which statement correctly describes the default runtime used by Docker Engine when running containers?
ADocker uses the Kata Containers runtime by default for enhanced security.
BDocker uses the runc runtime by default to create and run containers.
CDocker uses the cri-o runtime by default for container orchestration.
DDocker uses the containerd runtime by default to run containers.
Attempts:
2 left
💡 Hint
Think about the low-level runtime that Docker calls to create containers.
❓ Troubleshoot
advanced
2:00remaining
Diagnose Docker Engine Startup Failure
A user reports that Docker Engine fails to start with the error message: failed to start daemon: Error initializing network controller: Error creating default "bridge" network: failed to allocate gateway (172.17.0.1): Address already in use. What is the most likely cause?
AAnother process is already using the default Docker bridge network IP address range.
BDocker daemon configuration file is missing the bridge network settings.
CDocker Engine version is incompatible with the host kernel version.
DThe Docker socket file has incorrect permissions.
Attempts:
2 left
💡 Hint
The error mentions 'Address already in use' for the gateway IP.
🔀 Workflow
advanced
2:30remaining
Sequence to Change Docker Runtime
What is the correct sequence of steps to change the default Docker runtime from runc to nvidia runtime on a Linux host?
A2,1,3,4
B1,3,2,4
C3,1,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint
Configuration changes require daemon restart before verification.
✅ Best Practice
expert
3:00remaining
Best Practice for Docker Engine Security Hardening
Which of the following is the best practice to minimize security risks when running Docker Engine in production?
ARun Docker Engine as root user to ensure full access to system resources.
BDisable Docker Content Trust to speed up image pulls.
CUse user namespaces to map container users to non-root host users.
DAllow all containers to run with privileged mode for compatibility.
Attempts:
2 left
💡 Hint
Think about isolating container privileges from the host system.

Practice

(1/5)
1. What is the primary role of the Docker engine in container management?
easy
A. It manages and controls containers on your system.
B. It builds the Linux kernel for container support.
C. It acts as a cloud service for container hosting.
D. It provides a graphical interface for container design.

Solution

  1. Step 1: Understand Docker engine's function

    The Docker engine is the main software that manages containers, including building, running, and controlling them.
  2. Step 2: Compare options with this role

    Only It manages and controls containers on your system. correctly states that Docker engine manages and controls containers on your system.
  3. Final Answer:

    It manages and controls containers on your system. -> Option A
  4. Quick Check:

    Docker engine = container management [OK]
Hint: Docker engine controls containers, not builds kernels or UI [OK]
Common Mistakes:
  • Confusing Docker engine with cloud services
  • Thinking Docker engine builds the OS kernel
  • Assuming Docker engine is a GUI tool
2. Which of the following is the correct command to check the Docker engine version?
easy
A. docker version
B. docker check-version
C. docker show version
D. docker engine info

Solution

  1. Step 1: Recall Docker command syntax for version

    The correct command to check Docker engine version is docker version.
  2. Step 2: Validate other options

    Options A, B, and C are not valid Docker commands for checking version.
  3. Final Answer:

    docker version -> Option A
  4. Quick Check:

    Check version command = docker version [OK]
Hint: Use 'docker version' to see engine version quickly [OK]
Common Mistakes:
  • Using incorrect command names like 'docker check-version'
  • Confusing 'docker info' with version command
  • Trying 'docker engine info' which is invalid
3. What will be the output of the command docker ps when no containers are running?
medium
A. Displays an error saying no containers found
B. Lists all containers including stopped ones
C. Shows an empty list with only headers
D. Starts a new container automatically

Solution

  1. Step 1: Understand what 'docker ps' shows

    The command docker ps lists running containers only, showing headers even if none are running.
  2. Step 2: Analyze output when no containers run

    When no containers run, it shows an empty list with column headers but no container entries.
  3. Final Answer:

    Shows an empty list with only headers -> Option C
  4. Quick Check:

    docker ps with no containers = empty list [OK]
Hint: 'docker ps' shows running containers; empty if none run [OK]
Common Mistakes:
  • Thinking it lists stopped containers too
  • Expecting an error message when no containers run
  • Assuming it starts containers automatically
4. You run docker run -d nginx but get an error: "Cannot connect to the Docker daemon." What is the likely cause?
medium
A. The container is already running.
B. The nginx image does not exist on Docker Hub.
C. The command syntax is incorrect.
D. Docker daemon is not running on the system.

Solution

  1. Step 1: Understand the error message

    "Cannot connect to the Docker daemon" means the Docker engine service (daemon) is not running or accessible.
  2. Step 2: Check other options

    Image absence or syntax errors cause different errors; container running does not cause daemon connection errors.
  3. Final Answer:

    Docker daemon is not running on the system. -> Option D
  4. Quick Check:

    Daemon connection error = daemon not running [OK]
Hint: Daemon errors mean Docker service is stopped or unreachable [OK]
Common Mistakes:
  • Assuming image absence causes daemon errors
  • Blaming command syntax for daemon connection issues
  • Thinking container running causes this error
5. You want to run a container using a runtime other than the default Docker runtime. Which command option lets you specify the runtime?
hard
A. docker run --use-runtime=<runtime_name> <image>
B. docker run --runtime=<runtime_name> <image>
C. docker run --engine=<runtime_name> <image>
D. docker run --container-runtime=<runtime_name> <image>

Solution

  1. Step 1: Recall Docker run options for runtime

    The correct option to specify a runtime is --runtime followed by the runtime name.
  2. Step 2: Verify other options

    Options A, B, and D are not valid Docker CLI options for runtime selection.
  3. Final Answer:

    docker run --runtime=<runtime_name> <image> -> Option B
  4. Quick Check:

    Specify runtime with --runtime option [OK]
Hint: Use '--runtime' option to select container runtime [OK]
Common Mistakes:
  • Using incorrect flags like --engine or --use-runtime
  • Confusing runtime with engine options
  • Omitting the runtime option entirely
Recommended

Ready to prove it?

Pass the test and this pattern moves unknown strong while earning +1 Grip toward your certificate.

10 questions~5 mineasy hard