Containers

There is a running container that has a certain issue. You would like to share an image of that container with your team members, with certain environment variables set for debugging purposes. How would you do it?

Difficulty: unrated

Source: bregman-arie/devops-exercises by Arie Bregman

Answer

podman commit can be a good choice for that. You can create a new image of the running container (with the issue) and share that new image with your team members.

What you probably want to avoid using:

  • Using something as podman save/load as it applies on an image, not a running container (so you'll share the image but the issue might not be reproduced when your team members run a container using it)
  • Modifying Containerfile/Dockerfile as you don't really want to add environment variables meant for debugging to the source from which you usually build images