-
Notifications
You must be signed in to change notification settings - Fork 35
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
images: Minimize container #388
Conversation
Ugh, what is that now -- totally unrelated:
|
OK, seems I first need to debug that weird podman regression... |
202904e
to
612f539
Compare
I reported the podman failure at containers/podman#9432 , found a workaround, and added it here. |
The podman failure is known upstream and just got fixed. The current failure is now entirely my fault: |
612f539
to
66ee73a
Compare
Current podman 3.0.0 in system mode has a regression with handling anonymous volumes. See containers/podman#9432 for details. Work around this by placing RabbitMQ's data into a tmpfs volume.
Use a multi-stage build [1], pick some "small container targetted" basic packages, and remove some larger packages that we really don't need in the container. This shrinks the container from 313 to 137 MB. [1] https://docs.docker.com/develop/develop-images/multistage-build/
66ee73a
to
9e57cc1
Compare
Nice, works! Just pushing again to clean up the commit message for the podman workaround. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool stuff indeed!
I am not super convinced it actually is necessary for this image to try to slim it down for the cost of making the dockerfile much harder to read.
I am not against nor in favor.
Right, this was mostly a fun little learning project for me. It's not really relevant for production in this case, I'm also happy to just close this. |
I'd like to gain some experience with this, and also land the podman regression workaround. So if it's all the same to you, I'll land this. If it causes any problems, I'll revert. |
Use a multi-stage build [1], pick some "small container targetted" basic
packages, and remove some larger packages that we really don't need in
the container. This shrinks the container from 313 to 137 MB.
[1] https://docs.docker.com/develop/develop-images/multistage-build/
This was mostly a learning opportunity for me, I just saw @asamalik 's and @fatherlinux 's excellent building smaller container images devconf.cz talk. But then why not, now I earned some twitter bragging rights. 😁
I tested this locally, but our CI will test it in full.