CS FundamentalsHardAccenture · Product placement

An engineer runs docker exec into a running container, edits a config file, and later the container is removed and recreated from the same image. What happens to the edit?

  1. A. It is lost, because changes live in the container's writable layer; persistent data belongs in a volume and config changes belong in the image or the environment
  2. B. It is kept, because Docker commits changes automatically
  3. C. It is copied into the image
  4. D. It survives only if the container was stopped gracefully

Correct answer: A. It is lost, because changes live in the container's writable layer; persistent data belongs in a volume and config changes belong in the image or the environment

Containers are meant to be disposable: the writable layer dies with the container. Treating containers as immutable and rebuilding from versioned definitions avoids snowflake servers.

More Software Engineering, Git and Cloud Basics questions

Exams that ask this topic