-
Notifications
You must be signed in to change notification settings - Fork 350
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve Docker image sizes by using multistage build #2425
Comments
Thanks for your comment, @OSMOSA44! This is something I did deliberately and have decided to keep. The separate Unfortunately, this technique does not work with the e.g: docker build --build-arg APIMAN_DISTRO=apiman-distro-wildfly-3.1.0-SNAPSHOT-overlay.zip . Potentially, I could use a container compaction technique like |
You can use multi stage Docker build See this Dockerfile Testing commands below docker buildx build --platform=linux/amd64 --build-arg APIMAN_DISTRO=apiman-distro-vertx-3.0.0.Final.zip -t apiman/vertx-gateway:3.0.0.Final.local . or docker buildx build --platform=linux/amd64 --build-arg APIMAN_VERSION=3.0.0.Final -t apiman/vertx-gateway:3.0.0.Final.remote . Nota: To avoid warning and potentially errors, I have added the platform target parameter as i work on MacBook Pro M1 |
Thanks, that's a good idea. I'll chat with the team and we'll do some experiments. |
Hi,
When you write
The
rm /tmp/apiman-distro-vertx.zip
is inefficient because ADD and RUN command generate two distinct image layers and a layer cannot modify another layerTo delete the zip file, you have to download, unzip and delete on the same layer
For example (with use of wget)
You can use this usefull tool dive to inspect the image efficiency
Regards
The text was updated successfully, but these errors were encountered: