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
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,19 @@ RUN apt-get update && apt-get install -y \

RUN mkdir /usr/src/mysql \
&& curl -SL https://dev.mysql.com/get/Downloads/MySQL-5.6/mysql-5.6.17.tar.gz \
| tar -xzC /usr/src/mysql --strip-components=1
#ADD . /usr/src/mysql

WORKDIR /usr/src/mysql

RUN cmake .
RUN make -j"$(nproc)"
RUN make test
RUN make install
| tar -xzC /usr/src/mysql --strip-components=1 \
&& cd /usr/src/mysql \
&& cmake . -DCMAKE_BUILD_TYPE=Release \
-DWITH_EMBEDDED_SERVER=OFF \
&& make -j"$(nproc)" \
&& make test \
&& make install \
&& cd .. \
&& rm -rf mysql \
&& 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; }.

ENV PATH $PATH:/usr/local/mysql/bin:/usr/local/mysql/scripts

WORKDIR /usr/local/mysql
Expand Down