Sobes.tech
Middle

What happens after making changes to the image?

sobes.tech AI

Answer from AI

A new, unique image will be created with the new tag version. The old image will be preserved unless you use the docker image prune command.

# Example of changing an image:
# Adding a file to an existing image myimage:latest
FROM myimage:latest
COPY new_file.txt /app/
# Example of building a new image with a new tag
docker build -t myimage:v2.0 .

Consequences:

  • The new image has a different digest (unique identifier).
  • Containers running based on the old image will continue to operate on the old version.
  • To use the changes, you need to run new containers based on the new image.