Docker Registry u0026 Image Management Quiz Quiz

Explore your understanding of Docker registries and image management, including image tagging, pushing, pulling, authentication, and cleanup concepts. This quiz helps you solidify key skills for efficient and secure container image workflows.

  1. Tagging Images for Registry Upload

    Which of the following image tags enables pushing a Docker image to a private registry located at exampleregistry.com under the repository 'project/app'?

    1. project/app:latest
    2. latest:project/app
    3. exampleregistry.com/project/app:latest
    4. app:exampleregistry.com

    Explanation: To push an image to a remote registry, you must tag it with the registry’s address followed by the repository and tag, such as exampleregistry.com/project/app:latest. Omitting the registry address like in project/app:latest pushes to the default public registry, not the private one. app:exampleregistry.com is an incorrectly formatted tag that treats exampleregistry.com as a version. latest:project/app reverses the expected order and is not a valid tag format.

  2. Retrieving Images from a Registry

    You want to download a specific version of an image called 'backend' with the tag 'v2' from a custom registry 'customreg.io'. Which command syntax should you use?

    1. docker pull backend:v2
    2. docker pull backend:customreg.io
    3. docker pull customreg.io:backend/v2
    4. docker pull customreg.io/backend:v2

    Explanation: The correct syntax for pulling an image from a custom registry is docker pull customreg.io/backend:v2, specifying both the registry URL and the desired tag. backend:customreg.io incorrectly treats the registry as a tag. customreg.io:backend/v2 inverts the required structure. backend:v2 pulls from the default public registry, not the specified custom registry.

  3. Authenticating to a Registry

    After creating credentials for a private registry, which action allows you to store those credentials for future image pushes and pulls without re-entering them each time?

    1. docker auth
    2. docker authorize
    3. docker login
    4. docker signin

    Explanation: Using docker login prompts you to enter your credentials and stores them locally, allowing subsequent commands to authenticate automatically. docker signin and docker authorize are not valid Docker commands and will result in errors. docker auth is also not a recognized command for authentication.

  4. Removing Unused Images

    If you want to delete images from your local system that are not tagged and not used by any container, which command should you use?

    1. docker clean images
    2. docker image prune
    3. docker image delete
    4. docker remove unused

    Explanation: docker image prune removes dangling images, which are images not tagged and not referenced by any container, helping free disk space. docker image delete is not a valid command, and docker clean images as well as docker remove unused do not exist within standard Docker CLI operations. Only the prune command performs the requested cleanup.

  5. Understanding Image Layers

    Why does pushing a new Docker image with only one additional layer compared to an existing image in the registry make the upload process faster?

    1. Uploading more layers is always faster due to parallel transfers
    2. Images are always pushed as a single compressed file with all layers
    3. Only the new layer needs to be uploaded if the others already exist in the registry
    4. All layers must be uploaded again regardless of existing layers in the registry

    Explanation: When pushing an image, only layers not present in the remote registry are uploaded, which saves time and bandwidth for incremental changes. All layers do not need to be transferred if they already exist. Images are sent as individual layers, not as a single compressed file, and uploading more layers is not inherently faster as parallelism does not bypass the need to upload each new layer.