-
Notifications
You must be signed in to change notification settings - Fork 35
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
Optimize layers #42
Optimize layers #42
Conversation
Collpase installation layers and image went from 550Mb to 370mb
# Install required libs | ||
RUN set -ex; \ | ||
apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false; \ | ||
# Install required libs |
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.
Why would you move this?
# Install php libs | ||
RUN set -ex; \ | ||
\ | ||
aptMarkList="$(apt-mark showmanual)"; \ | ||
\ | ||
apt-get update; \ | ||
# Install php libs |
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.
The whole thing is about PHP, so may not move this?
@whalelines the answer to both questions is that the second install step relies on the cache not being cleared in the previous step. So either we duplicate the update and clear cache or we put them in the same layer. The latter is faster to build |
But if you are combining those two |
That purge gets rids of build dependencies for the PHP deps which is not the same as the cache. |
@LaurentGoderre thanks for your contribution |
Collpase installation layers and image went from 550Mb to 370mb