Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 13c1711

Browse files
authored
ref(Dockerfile): use base 0.3.2, smaller packages and better cleanup (#1088)
1 parent 260b1e4 commit 13c1711

File tree

1 file changed

+27
-9
lines changed

1 file changed

+27
-9
lines changed

rootfs/Dockerfile

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM quay.io/deis/base:0.3.1
1+
FROM quay.io/deis/base:v0.3.4
22

33
RUN adduser --system \
44
--shell /bin/bash \
@@ -9,21 +9,39 @@ RUN adduser --system \
99

1010
COPY requirements.txt /app/requirements.txt
1111

12-
RUN buildDeps='gcc git libffi-dev libpq-dev python3-dev'; \
12+
RUN buildDeps='gcc git libffi-dev libpq-dev python3-dev python3-pip python3-wheel python3-setuptools'; \
1313
apt-get update && \
1414
apt-get install -y --no-install-recommends \
1515
$buildDeps \
16+
sudo \
1617
libpq5 \
17-
python3 \
18-
sudo && \
18+
python3-minimal \
19+
# cryptography package needs pkg_resources
20+
python3-pkg-resources && \
1921
ln -s /usr/bin/python3 /usr/bin/python && \
20-
curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.2 && \
2122
mkdir -p /configs && chown -R deis:deis /configs && \
22-
pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt && \
23-
rm -rf /root/.cache/pip/* && \
23+
pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt && \
24+
# cleanup
2425
apt-get purge -y --auto-remove $buildDeps && \
25-
apt-get clean && \
26-
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc
26+
apt-get autoremove -y && \
27+
apt-get clean -y && \
28+
# package up license files if any by appending to existing tar
29+
COPYRIGHT_TAR='/usr/share/copyrights.tar'; \
30+
gunzip $COPYRIGHT_TAR.gz; tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright; gzip $COPYRIGHT_TAR && \
31+
rm -rf \
32+
/usr/share/doc \
33+
/usr/share/man \
34+
/usr/share/info \
35+
/usr/share/locale \
36+
/var/lib/apt/lists/* \
37+
/var/log/* \
38+
/var/cache/debconf/* \
39+
/etc/systemd \
40+
/lib/lsb \
41+
/lib/udev \
42+
/usr/lib/x86_64-linux-gnu/gconv/IBM* \
43+
/usr/lib/x86_64-linux-gnu/gconv/EBC* && \
44+
bash -c "mkdir -p /usr/share/man/man{1..8}"
2745

2846
COPY . /app
2947

0 commit comments

Comments
 (0)