Docker Associate Docker Image Management Quiz

Reviewed by Editorial Team
The ProProfs editorial team is comprised of experienced subject matter experts. They've collectively created over 10,000 quizzes and lessons, serving over 100 million users. Our team includes in-house content moderators and subject matter experts, as well as a global network of rigorously trained contributors. All adhere to our comprehensive editorial guidelines, ensuring the delivery of high-quality content.
Learn about Our Editorial Process
| By Thames
T
Thames
Community Contributor
Quizzes Created: 11982 | Total Attempts: 187,298
| Questions: 20 | Updated: Aug 16, 2026
Please wait...
Question 1 / 21
🏆 Rank #-- ▾
0 %
0/100
Score 0/100

1. Multi-stage builds in Docker help reduce final image size by separating ____ and runtime stages.

Explanation

Multi-stage builds keep compilers, dependencies, and other tools in a build stage, then copy only the required application files into the runtime stage, reducing the final Docker image size.

Submit
Please wait...
About This Quiz
Docker Associate Docker Image Management Quiz - Quiz

This quiz evaluates your understanding of Docker image management, a core skill for the Docker Certified Associate certification. You'll test your knowledge of image creation, storage, registry operations, and best practices for building and maintaining container images in production environments.

2.

What first name or nickname would you like us to use?

You may optionally provide this to label your report, leaderboard, or certificate.

2. Image layers are stacked in a ____ fashion, where each layer builds on the previous one.

Explanation

Image layers are immutable once created, so they remain read-only. Each new layer adds changes on top of the layers beneath it, forming the complete image.

Submit

3. Which command creates a new image from a running container's changes?

Explanation

`docker commit` creates a new image from a container’s filesystem changes, preserving the container’s configuration as well. `docker save` packages an existing image, while `docker export` archives a container’s filesystem without creating an image. `docker snapshot` is not a standard Docker command.

Submit

4. What does CMD differ from ENTRYPOINT in terms of container startup?

Explanation

ENTRYPOINT defines the command that runs when the container starts. CMD provides default arguments or a default command, which can be replaced by values supplied when the container is launched. When both are set, CMD commonly supplies arguments to ENTRYPOINT.

Submit

5. True or False: Docker images can be shared across different machines and operating systems.

Explanation

Docker images can be pushed to and pulled from registries, making them easy to share across machines. Images can also target different operating systems and CPU architectures, though a particular image must be compatible with the host’s platform or run through a suitable virtualization layer.

Submit

6. Which command shows detailed information about an image, including layers?

Explanation

`docker inspect` displays detailed, low-level information about a Docker object, such as an image or container. For images, its output includes metadata and layer details. The other listed commands do not provide this image-inspection function.

Submit

7. The WORKDIR instruction sets the ____ directory inside the container.

Explanation

WORKDIR specifies the directory within the container where subsequent instructions, such as RUN, CMD, and ENTRYPOINT, will be executed.

Submit

8. Which command retrieves an image from a registry without running it?

Explanation

`docker pull` downloads an image from a container registry to your local system without starting a container or running the image.

Submit

9. True or False: An image layer becomes immutable once it is created.

Explanation

Image layers are read-only snapshots of a filesystem, so their contents do not change after creation. When an image is modified, the system creates a new layer that records the changes rather than altering an existing layer. This immutability helps make images consistent, reusable, and easier to cache across builds and deployments.

Submit

10. Which instruction sets the default command to run when a container starts?

Explanation

In a Dockerfile, `CMD` specifies the default command and arguments that a container runs when it starts. This command is used unless one is supplied when launching the container. `RUN` executes commands while building the image; `EXEC` and `START` do not set a container’s default command.

Submit

11. Which command creates a Docker image from a Dockerfile in the current directory?

Explanation

Running `docker build .` instructs Docker to build an image using the Dockerfile in the current directory. The `.` specifies the build context, making files in that directory available to the build process.

Submit

12. What does the EXPOSE instruction do in a Dockerfile?

Explanation

EXPOSE serves as documentation that a containerized application listens on specified ports. It does not publish those ports to the host; you must configure port mapping when running the container, such as with `docker run -p`.

Submit

13. Which command pushes a local image to a Docker registry?

Explanation

Use `docker push` to upload a locally available Docker image to a registry, such as Docker Hub. The image must be tagged with the registry and repository name, and you must be authenticated if the registry requires it.

Submit

14. COPY and ADD instructions in a Dockerfile differ in that ADD can ____ files from remote URLs.

Explanation

Unlike COPY, which copies files from the build context or another build stage, ADD also accepts a URL as its source and fetches that resource during the image build. This lets a Dockerfile retrieve a file from a remote location without a separate download command. ADD can also automatically extract certain local archive files.

Submit

15. Which command removes an image from your local system?

Explanation

Use `docker rmi` followed by an image name or ID to remove that image from the local Docker system. For example, `docker rmi nginx:latest` removes the local `nginx:latest` image. The `docker rm` command removes containers, not images, while `docker delete` and `docker remove image` are not standard Docker commands.

Submit

16. What is the purpose of a .dockerignore file?

Explanation

A `.dockerignore` file lists files and directories Docker should omit from the build context when building an image. This reduces the amount of data sent to the Docker daemon and helps avoid including unnecessary or sensitive files in the image.

Submit

17. Which command lists all images stored locally on your system?

Explanation

Use `docker images` to display the Docker images available locally on your system. The output typically includes each image’s repository, tag, image ID, creation time, and size. This command lists images stored on the machine, rather than containers currently running.

Submit

18. The RUN instruction in a Dockerfile executes during image ____.

Explanation

`RUN` commands execute while Docker builds the image. Their effects, such as installing packages or creating files, are saved in the resulting image layer. By contrast, instructions such as `CMD` specify commands to run when a container starts.

Submit

19. Which flag tags an image with a custom name and version?

Explanation

The `-t` or `--tag` flag assigns an image a custom name and version identifier, typically in the format `name:version`. For example, `docker build -t myapp:1.0 .` creates an image tagged as `myapp` with version `1.0`. This makes the image easier to identify, reference, and manage.

Submit

20. What does the FROM instruction in a Dockerfile specify?

Explanation

The `FROM` instruction sets the base image for a Docker build. It provides the starting filesystem and environment on which the remaining Dockerfile instructions build.

Submit
×
Saved
Thank you for your feedback!
View My Results
Cancel
  • All
    All (20)
  • Unanswered
    Unanswered ()
  • Answered
    Answered ()
Multi-stage builds in Docker help reduce final image size by...
Image layers are stacked in a ____ fashion, where each layer builds on...
Which command creates a new image from a running container's changes?
What does CMD differ from ENTRYPOINT in terms of container startup?
True or False: Docker images can be shared across different machines...
Which command shows detailed information about an image, including...
The WORKDIR instruction sets the ____ directory inside the container.
Which command retrieves an image from a registry without running it?
True or False: An image layer becomes immutable once it is created.
Which instruction sets the default command to run when a container...
Which command creates a Docker image from a Dockerfile in the current...
What does the EXPOSE instruction do in a Dockerfile?
Which command pushes a local image to a Docker registry?
COPY and ADD instructions in a Dockerfile differ in that ADD can ____...
Which command removes an image from your local system?
What is the purpose of a .dockerignore file?
Which command lists all images stored locally on your system?
The RUN instruction in a Dockerfile executes during image ____.
Which flag tags an image with a custom name and version?
What does the FROM instruction in a Dockerfile specify?
play-Mute sad happy unanswered_answer up-hover down-hover success oval cancel Check box square blue
Alert!