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

Reduce the size of the image #1

Merged
merged 1 commit into from
Jun 19, 2014
Merged

Conversation

mwcampbell
Copy link

By combining all of the steps to download the source, build it, and clean up afterward into a single RUN command, and by adding a few extra cleanup steps and CMake options, I reduced the size of this image from about 3 GB to about 500 MB, with no loss of functionality.

&& rm -rf /usr/local/mysql/mysql-test \
&& rm -rf /usr/local/mysql/sql-bench \
&& find /usr/local/mysql -type f -name "*.a" -delete \
&& ((find /usr/local/mysql -type f -print | xargs strip --strip-all) || true)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we swap this to use curly braces instead of parenthesis to prevent the creation of a subshell environment? See command grouping for more information. Also, can we change those double quotes around *.a to single quotes?

Could we swap the -print piping to xargs to just use -exec directly?

Combining the two we would get: && { find /usr/local/mysql -type f -executable -exec strip --strip-all '{}' + || true; }.

@yosifkit yosifkit merged commit 1593c8f into docker-library:master Jun 19, 2014
@tianon
Copy link
Member

tianon commented Jun 19, 2014

Just to note, @yosifkit made the changes we requested. Thanks for the contribution! :)

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

Successfully merging this pull request may close these issues.

3 participants