Dockerfile: Clean up to save space (#891)
Running postgrest requires the libpq library runtime, not the -dev package. Make sure that tools that are used to download and extract the postgrest package do not remain installed in the image.
This commit is contained in:
committed by
Joe Nelson
parent
1c09058628
commit
3165d5dbc0
+17
-8
@@ -1,15 +1,24 @@
|
|||||||
FROM debian:jessie
|
FROM debian:jessie
|
||||||
|
|
||||||
ENV POSTGREST_VERSION 0.4.1.0
|
# Install libpq5
|
||||||
|
RUN apt-get -qq update && \
|
||||||
|
apt-get -qq install -y --no-install-recommends libpq5 && \
|
||||||
|
apt-get -qq clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
RUN apt-get update && \
|
# Install postgrest
|
||||||
apt-get install -y tar xz-utils wget libpq-dev && \
|
RUN POSTGREST_VERSION="0.4.1.0" \
|
||||||
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
BUILD_DEPS="curl ca-certificates xz-utils" && \
|
||||||
|
apt-get -qq update && \
|
||||||
RUN wget http://github.com/begriffs/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
apt-get -qq install -y --no-install-recommends $BUILD_DEPS && \
|
||||||
tar --xz -xvf postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
cd /tmp && \
|
||||||
|
curl -SLO https://github.com/begriffs/postgrest/releases/download/v${POSTGREST_VERSION}/postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
||||||
|
tar -xJvf postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz && \
|
||||||
mv postgrest /usr/local/bin/postgrest && \
|
mv postgrest /usr/local/bin/postgrest && \
|
||||||
rm postgrest-${POSTGREST_VERSION}-ubuntu.tar.xz
|
cd / && \
|
||||||
|
apt-get -qq purge --auto-remove -y $BUILD_DEPS && \
|
||||||
|
apt-get -qq clean && \
|
||||||
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|
||||||
COPY postgrest.conf /etc/postgrest.conf
|
COPY postgrest.conf /etc/postgrest.conf
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user