Skip to content

Reduce the size of the image #1

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

Closed
Closed
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
25 changes: 17 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,15 +15,24 @@ RUN curl -o /usr/local/bin/gosu -SL 'https://github.com/tianon/gosu/releases/dow
&& chmod +x /usr/local/bin/gosu

ADD . /usr/src/postgres
WORKDIR /usr/src/postgres

RUN ./configure
RUN make -j"$(nproc)"
RUN chown -R postgres src/test/regress \
&& gosu postgres make check \
|| { cat >&2 /usr/src/postgres/src/test/regress/log/initdb.log; false; }
RUN make install

RUN cd /usr/src \
&& cp -a postgres postgres-build \
&& cd postgres-build \
&& ./configure \
&& make -j"$(nproc)" \
&& chown -R postgres src/test/regress \
&& (gosu postgres make check \
|| { cat >&2 /usr/src/postgres/src/test/regress/log/initdb.log; false; }) \
&& make install \
&& cd .. \
&& rm -rf postgres-build \
&& find /usr/local/pgsql -type f -name "*.a" -delete \
&& ((find /usr/local/pgsql -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.

Similar comment as on PR#1 for docker-library/docker-mysql.

Thanks for your help.

&& rm -rf /usr/local/pgsql/include \
&& rm -rf /usr/local/pgsql/lib/pgxs

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

ENV PGDATA /var/lib/postgresql/data
Expand Down