Skip to content
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 build dependencies after docker-php-ext-install #557

Closed
J0WI opened this issue Jan 4, 2018 · 4 comments
Closed

Remove build dependencies after docker-php-ext-install #557

J0WI opened this issue Jan 4, 2018 · 4 comments
Labels
Request Request for image modification or feature

Comments

@J0WI
Copy link
Contributor

J0WI commented Jan 4, 2018

Since removing build dependencies after installing PHP extensions (e.g. docker-library/wordpress#267) seems to be a common task it would make sense to have such a functionality in the docker-php-ext-* scripts.

@wglambert wglambert added the Request Request for image modification or feature label Apr 25, 2018
@ebuildy
Copy link

ebuildy commented May 16, 2018

/usr/src/php.tar.xz can be removed too ?

docker run --rm php:7.2.5-cli-alpine3.7 ls -alh /usr/src => 11.5M (16% of the total image size)

@J0WI
Copy link
Contributor Author

J0WI commented May 16, 2018

Nope, that is used here.

@ebuildy
Copy link

ebuildy commented May 16, 2018

yes, I mean, once we have installed the dependencies, we could remove it too (not use at run-time).

@yosifkit
Copy link
Member

As for deleting the source, that would be a duplicate of #488.

For auto-removing build dependencies that we add, that is done in the Alpine images:

php/docker-php-ext-install

Lines 116 to 118 in 4017680

if [ "$pm" = 'apk' ] && [ -n "$apkDel" ]; then
apk del $apkDel
fi

We don't auto-add build dependencies in Debian since any needed for phpize are already installed. See #513 (comment) and #438 for why we don't auto add/remove packages in Debian.

As for any other dependencies that could be installed in a Dockerfile, since we didn't add them, we can't reasonably detect that they can be removed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Request Request for image modification or feature
Projects
None yet
Development

No branches or pull requests

4 participants