Cloud and Container Basics

A container image built by a CI/CD pipeline was tested in the staging environment and passed. Which of the following is the most appropriate way to release this image to production?

  1. ABuild the image again from the same source code for production and release that to production
  2. BRetag the tested image as latest, and pull latest in the production environment
  3. CRelease the tested image itself to production by specifying its digest, and supply the differences between environments through configuration
Show answer and explanation

Answer: C. Release the tested image itself to production by specifying its digest, and supply the differences between environments through configuration

In a pipeline, the artifact produced by the build (here, the image) is treated as unchangeable, and the same artifact is promoted from staging to production. Even from the same source code, a rebuild may pick up different versions of the libraries or base image it depends on, so something different from what was tested would reach production. A tag can later be moved to another image, so to be sure of pointing to the same image, use the digest, which is determined by the contents. Differences between environments, such as connection targets, are not built into the image but supplied through configuration such as environment variables.

  • A. A rebuild may change dependent libraries and produce an image different from the one tested.
  • B. latest is a tag that can be moved, so at pull time it may point to a different image.
  • C. Correct. The digest guarantees that the same image that was tested goes to production.
Practice this topic Back to topic

Books on Cloud and Container Basics Ad

As an Amazon Associate I earn from qualifying purchases.

More Cloud and Container Basics questions

  1. As shown above, the database connection target is not written into the image but passed as an environment variable when the container starts. Which of the following is the most appropriate main advantage of this design?
  2. In a system in which several services work together, you want to find out which services a single user request passed through, in what order, and how much time it spent in each. Among the data used for observability, which of the following is the most suitable?
  3. Among the Linux kernel features that make containers possible, which of the following correctly pairs namespaces and cgroups (control groups) with their roles?
  4. On a Linux host, Docker is used to start a container from an image based on a different distribution from the host, and uname -r (which shows the kernel release) and cat /etc/os-release (which shows information about the distribution) are run inside it. Which of the following correctly describes the results?
  5. Which of the following correctly describes the relationship between a container image and a container?