Closed lalyos closed 6 years ago
@lalyos How to you know this is about building new images with docker build --squash
?
When looking at this topic in the topic guide I came to the conclusion that this has to be about flattening an existing image, because it says "modify an image to a single layer". For an existing image this cannot be done with docker build
, right?
the previous questions were about how build an image, describe Dockerfile options, and so on. So my assumption was that we have a Dockerfile. All automated images have a Dockerfile.
But you are right the word "modify" seem to imply there is an already existing image. Still if there is an existing image, you can overwrite (retag) with docker buid --squash
. Overwriting an existing images is modifying it.
Well, maybe we need to clarify the meaning of "modify an image to a single layer" with the authors of the study guide.
In the meantime we could just add both with a note about how it is not clear what is meant.
Also while docker export
works with a container, docker image import
creates an image.
What do you think?
I've updated the PR by having two options.
docker build can squash the image