PRACTICE / UNDERSTAND / REPEAT

Docker MCQ Practice

Practice container lifecycle, Dockerfiles, port publishing, storage, and resource configuration.

253 questionsAnswers explainedFree · no login

Put your knowledge to the test.

A random set of up to 10 questions from Docker. Your answers stay on this page.

Choose a topic

Try a few questions

Open a topic above to explore the complete question bank.

01 / Images & containers · MCQQuestion link ↗

Which command lists running containers?

Choose one answer
Answer & explanation

Answer: docker ps

`docker ps` lists running containers. Add `-a` to include stopped containers.

02 / Images & containers · MCQQuestion link ↗

What does `docker run -d nginx` do?

Choose one answer
Answer & explanation

Answer: Starts a container in the background

`-d` runs the new container detached from the terminal.

03 / Storage · MCQQuestion link ↗

Which Docker storage type is designed to persist data independently of a container’s writable layer?

Choose one answer
Answer & explanation

Answer: Volume

A volume has a lifecycle independent of an individual container and is commonly used for persistent data.

04 / Networking · MCQQuestion link ↗

In `-p 8080:80`, which side is the host port?

Choose one answer
Answer & explanation

Answer: 8080

Port publishing uses `HOST_PORT:CONTAINER_PORT`, so host port 8080 forwards to container port 80.

05 / Dockerfiles · MCQQuestion link ↗

Which Dockerfile instruction selects the base image?

Choose one answer
Answer & explanation

Answer: FROM

`FROM` begins a build stage and names its base image.

06 / Images & containers · Code recallQuestion link ↗

Complete the command that lists locally available images.

docker ___
Answer & explanation

Answer: images

`docker images` lists images stored locally.