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.
Which of the following image tags enables pushing a Docker image to a private registry located at exampleregistry.com under the repository 'project/app'?
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.
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?
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.
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?
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.
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?
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.
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?
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.