-
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
Build SOAP extension as shared instead of static #39
Conversation
Ah, nice! Definitely +1, SOAP is not the most common extension in PHP, so disabling by default should be fine for most users. |
Certainly. If anyone has come to rely on a statically linked SOAP extension in the last few days, I apologize in advance for this breaking change. FYI, I've opened docker-library/docs#94 to document the extension situation. |
I just had the urge to try out using And here's the result:
|
Very, very interesting POC. 😄 All that really concerns me is the size of |
Duplicating my comment from the POC commit here: I just built 5.6-apache locally based on master and this branch and here's what I saw:
|
A little bit hefty, but considering that we used to be at 800-900 MB, I think that's reasonable, and especially compared to the huge amount it would end up being to compile everything shared. Do you think it would be worthwhile to wrap up your few lines of "compile mbstring" into some kind of helper script to make it easy to say something like Do you think this method might work for FPM and Apache2 compilation as well? I guess we ought to start here and play with it from there. 😄 |
I wasn't sure whether do suggest something like As for the FPM and Apache2 compilation, I'm not sure. Looking at the FPM changes, that could probably be done using the approach I used in the POC branch for mbstring. |
Just did a test with the following patch: diff --git a/5.6/Dockerfile b/5.6/Dockerfile
index afbd82c..15076d7 100644
--- a/5.6/Dockerfile
+++ b/5.6/Dockerfile
@@ -47,7 +47,7 @@ RUN buildDeps=" \
&& make install \
&& { find /usr/local/bin /usr/local/sbin -type f -executable -exec strip --strip-all '{}' + || true; } \
&& apt-get purge -y --auto-remove $buildDeps \
- && rm -r /usr/src/php
+ && make clean And got the following size comparison:
Which is basically exactly 100MB. Nice. Let's start here and see where it goes! (Will be sending a PR shortly.) |
As for extra deps, couldn't we just leave installing them as an exercise for the reader? ie, we document that you should The alternative would be to maintain a list of build-deps necessary per-package, and perhaps runtime deps too, since those are going to be different as well. |
Taking
That is, the runtime dependencies would be explicitly installed, but the dev dependencies would be installed and then removed by |
@md5, I like the idea, but can I only install one extension per run of Maybe it could be
Some extensions might have one, multiple, or no build deps, so this allows any of them. |
So with that example, why not just have the users of the image do something more like this: FROM php:5.6
RUN apt-get update && apt-get install -y libmcrypt4
RUN apt-get update && apt-get install -y libmcrypt-dev \
&& docker-phpize mcrypt \
&& apt-get purge --auto-remove -y libmcrypt-dev That way, our script doesn't "accidentally" remove something the user didn't expect, and |
Also, then users who don't care as much about size as we do in the official image could just put |
So, we want a tool to As far as soap to a shared extension: LGTM |
I'm thinking we should maybe just implement that, and remove |
Do we want to move it to a shared library anyway so that no one gets used to the automatic soap? |
Well, it's not included in docker-library/official-images#308, so I'm not too worried about it yet. We didn't release SOAP yet previously, right? |
I'm fine with having |
It was merged ibn #35, but I see it did not get pushed into official-images, so it has not been "released". |
Updates the changes in #35 to build SOAP extension as shared instead of static.