Can I build with multiple compression types? #2977
-
I wanted to build two images, one compressed with gzip and one with zstd, but I wanted to ensure that the images are exactly the same. The concern with running two build commands right after another is that the base image may change between the two builds. So I was wondering if there was a way for me to build two images at once, or take one image and uncompress and recompress it, or any other way to achieve this. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
There is no way to specify multiple compression types for same build. When builds are invoked in parallel(second invoked before first completes) they are guaranteed to get the same base image. Other option is to use |
Beta Was this translation helpful? Give feedback.
There is no way to specify multiple compression types for same build.
When builds are invoked in parallel(second invoked before first completes) they are guaranteed to get the same base image.
Other option is to use
buildx bake
with a context pointing to the previous build that just returns the context itself. Then you can have many bake targets with their own exporter options building the same thing. Last section https://www.docker.com/blog/dockerfiles-now-support-multiple-build-contexts/