GH-200 practice question 2 of 15

As a developer, which workflow steps should you perform to publish an image to the GitHub Container Registry? (Choose three.)

Full set: 100 questions
Answer options
A: Use the actions/setup-docker action
B: Authenticate to the GitHub Container Registry. Correct answer
C: Build the container image. Correct answer
D: Push the image to the GitHub Container Registry Correct answer
E: Pull the image from the GitHub Container Registry.
Correct Answer:
B. Authenticate to the GitHub Container Registry.; C. Build the container image.; D. Push the image to the GitHub Container Registry
Explanation

Publishing a container image to a registry, including the GitHub Container Registry (GHCR), follows a standard procedure. First, you must authenticate with the registry to gain push access (B). Next, you must build the container image from its source, such as a Dockerfile (C). Finally, after the image is successfully built and tagged, you push it to the designated registry (D). These three steps represent the core lifecycle of publishing a container image.

Why Incorrect

Option A is incorrect because while actions/setup-docker is a useful action for setting up Buildx, it is not a fundamental step; building can be done without it.
Option E is incorrect because pulling an image is an act of consuming or downloading it from the registry, not publishing it.

References

- GitHub Docs. (n.d.). Publishing Docker images. Retrieved from https://docs.github.com/en/actions/publishing-packages/publishing-docker-images. This guide outlines the standard workflow, which includes logging in to the registry, and then building and pushing the image.

Scroll to Top