-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Remove php src the right way for lightweight containers #234
Comments
I didn't think that the src was that huge:
I am leaning on the side of keeping the source tar around rather than hammering the php.net servers. |
@yosifkit yes indeed this is an interesting alternative & would avoid download roundtrips 👍 |
Suppose better to download src when needed, all containers that will be inherited from official ones also needs source only for build time in 99% use-cases |
@andypost yes... but in fact if we download again the source, should be done once during the build of a derived container. With my initial proposal it's not optimized at all as it download source each time you try to install or configure some php ext. So... I guess I could refine the proposed
ping @yosifkit @andypost does it look like the best of both worlds? |
@shouze I think there's no need to keep to store "flag-file" because you can always check for tarball file and extracted folder instead. |
@andypost yup, file existence should be sufficient... in fact a flag file could be created only to automate deletion of source and/or tarball only if the source & tarball haven't been downloaded/extracted by It's a bit similar than in #239 to illustrate. |
Hi guys,
in the same way we do for alpine packages in #206... maybe we can think about removing
/usr/src/php
from the produced container image & make things easy to restore it?Basically, I was thinking about:
&& rm -rf /usr/src/php
heredocker-grab-php-source.sh
that can manage the whole download/gpg check & so onAs
/usr/src/php
for php7 weights around 190M inside a running alpine image, I guess we can reduce the final image size by 10 to 20M (which is about the sizes of compressed php releases source code artifacts.).To sum up, this can be around 25 to 50% gain for the final image size.
Also, this can be applied to non Alpine Linux images I guess, as it was tried with a non working approach in #96.
ping @tianon @ncopa what do you thing about that?
The text was updated successfully, but these errors were encountered: