-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Reduce size of python image #45
Comments
Have you looked at slim? The slim versions are designed for those that want to minimize their footprint (docs), but they will need to install any system libraries. As far as reducing the |
Hi @yosifkit, I looked at the slim image and noticed that you are pulling in all of the make utilities and building python from source, which makes this image HUGE. Wouldn't it make sense to just include the pre-built binaries, and not including all of the make utilities? I know it would drastically reduce the size of the image. Having the build service included in the docker image seems a bit overkill to me. |
Maybe people wouldn't have to be presumptuous and try and remove 63 MB of non-English locales if the "reduced footprint" of the slim image wasn't contrived from a dockerfile that builds from source and then is released on the registry with all of the make/gcc/build utils still installed, sucking up additional space.. You guys should have your own internal dockerfile that builds from source, and then a released official image that includes something lightweight like wheezy or even jessie bare, with nothing but the pre-built binaries... IMO just a pure python container shouldn't be more than 150 MB... Who wants the footprint of any sort of build utils on an official image that is meant to just merely run an application.. it goes against the paradigm of containerization... 1 container to just do 1 thing and 1 thing really well... running a python app is the one thing.. not building python from source and then running the python app on the same server... Just My Opinion... |
@dsikes and @appcontainers, none of those build packages are kept in the final image: slim/Dockerfile#L55. The only things kept are: ca-certs, libsqlite3, and libssl (slim/Dockerfile#L11-13).
I would welcome a PR making a smaller python based on |
While you're at it how about removing the |
Is this issue still relevant now that we have both a $ docker images python
REPOSITORY TAG IMAGE ID CREATED SIZE
python 3-alpine 956bddfd0b6c 3 days ago 89.42 MB
python 3-slim c22a44a1fc6c 9 days ago 218.4 MB
python 3 af91e46ec581 9 days ago 689.1 MB |
I think that it improved enough to close this issue. Thanks! |
1.01 GB?! There is something deeply wrong with the default "official" image. |
Do you have some constructive feedback to share, or are you just here to complain/abuse? While I appreciate your edit that clarifies which thing you're complaining about, your tone is inappropriate for this forum. Please be more mindful of the humans on the other end of your comments in the future. In the spirit of good faith, I will direct you to the "Image Variants" section of https://hub.docker.com/_/python which notes/describes this in more detail -- every choice we make in this regard is a tradeoff between various aspects of usability, security, size, etc, and we're sorry that the tradeoffs we have chosen do not meet your needs, but it is pretty disingenuous to discount our attempts to do so in the "non-default" variants (slim, alpine), and the amount of work that goes into maintaining them.
( vs
( vs
( |
Of course I have switched to alpine immediately. But I am sure that most of people will just use the most default thing which runs somehow. And it means that a lot of automations over the world will be inefficient or avoid usage of the image (based on the first impression). That's why I believe default should be tiniest. As to
I would just respond with the same statement. Be mindful in your accusations. |
I would suggest using
ncdu /
in the image to show candidates for purging.E.g.:
A concrete example for purging would be
/usr/share/doc/gcc-4.9-base/test-summaries
.Maybe
localepurge
could be used to only ship English locales in the default image?Ref: #30 #37
The text was updated successfully, but these errors were encountered: