-
Notifications
You must be signed in to change notification settings - Fork 70
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
Streamline the build of the image #163
Conversation
0de9fae
to
aa19dcc
Compare
b35e19c
to
54a767e
Compare
Grr. sqlsrv build is failing because of a bug in msphpsql: Have to pin some packages to old versions. |
af9c56e
to
6553f25
Compare
60702f7
to
6f1d842
Compare
Build failure resolved. There seems to be a version of unixodbc in the microsoft repo which is broken and leads to incorrect builds. We have to keep the install of unixodbc to a point before we add the microsoft apt repo. |
Hi Andrew, it looks perfect! Only 1 little thing and 1 question:
Ot to add one more RUN, at the end, to perform it only once? Ciao :-) |
6f1d842
to
1c624f9
Compare
Thanks - I wasn't sure if unixodbc was used by any other DBs for compilation as it's not a package I'm very familiar with. Moved to the sqlsrv step only.
It's much better to have each RUN command perform a complete setup and teardown itself. The rationale is:
In this case I'd say this applies too, even though we have some shared setup in each step. Whatever we do, local development will be significantly faster than it previously was. For reference, whilst trying to iterate on the new entrypoint issue I was spending 6-7 minutes rebuilding the image each time I tweaked the entrypoint shell script. With these commit in place, it takes about 5-10 seconds to do exactly the same change. |
This change makes it much faster to make smaller changes to the image by: - moving the ADD commands to more targeted additions in order of build size - breaking out the Oracle and sqlsrv builds into their own ADD and RUN sections in the Dockerfile - moving the addition of non build-related files to right at the end of the Dockerfile These changes mean that it is possible to more easily developer the image, for example: - you can now make changes to files within the /usr directory without recompiling all PHP extensions - you can now iterate on the Oracle and/or sqlsrv extensions without recompiling all PHP extensinos - you can now iterate on the sqlsrv extension, without recompiling all PHP extensions Whist this has little effect on the end image, or the build process within CI systems, local development is substantially improved (unless you're making changes to the php-extensions.sh script).
1c624f9
to
251fea0
Compare
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.
Sold, thanks!
(I'll try to backport this to all the >= 8.0 7.4 images after master's rebuild ends)
Edited: s/8.0/7.4, so we can backport other PRs, based on this one also to 7.4.
Done, this has been backported to all >= 7.4 versions. They are still being built, but all ok, so far. |
This change makes it much faster to make smaller changes to the image by:
These changes mean that it is possible to more easily develop the image, for example:
Whist this has little effect on the end image, or the build process within CI systems, local development is substantially improved (unless you're making changes to the php-extensions.sh script).