From 13c1711f8843c8633d93abccdabc727093e1f89e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helgi=20=C3=9Eormar=20=C3=9Eorbj=C3=B6rnsson?= Date: Mon, 26 Sep 2016 17:36:52 -0700 Subject: [PATCH] ref(Dockerfile): use base 0.3.2, smaller packages and better cleanup (#1088) --- rootfs/Dockerfile | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 603090f86..5c999b846 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/deis/base:0.3.1 +FROM quay.io/deis/base:v0.3.4 RUN adduser --system \ --shell /bin/bash \ @@ -9,21 +9,39 @@ RUN adduser --system \ COPY requirements.txt /app/requirements.txt -RUN buildDeps='gcc git libffi-dev libpq-dev python3-dev'; \ +RUN buildDeps='gcc git libffi-dev libpq-dev python3-dev python3-pip python3-wheel python3-setuptools'; \ apt-get update && \ apt-get install -y --no-install-recommends \ $buildDeps \ + sudo \ libpq5 \ - python3 \ - sudo && \ + python3-minimal \ + # cryptography package needs pkg_resources + python3-pkg-resources && \ ln -s /usr/bin/python3 /usr/bin/python && \ - curl -sSL https://bootstrap.pypa.io/get-pip.py | python - pip==8.1.2 && \ mkdir -p /configs && chown -R deis:deis /configs && \ - pip install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt && \ - rm -rf /root/.cache/pip/* && \ + pip3 install --disable-pip-version-check --no-cache-dir -r /app/requirements.txt && \ + # cleanup apt-get purge -y --auto-remove $buildDeps && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc + apt-get autoremove -y && \ + apt-get clean -y && \ + # package up license files if any by appending to existing tar + COPYRIGHT_TAR='/usr/share/copyrights.tar'; \ + gunzip $COPYRIGHT_TAR.gz; tar -rf $COPYRIGHT_TAR /usr/share/doc/*/copyright; gzip $COPYRIGHT_TAR && \ + rm -rf \ + /usr/share/doc \ + /usr/share/man \ + /usr/share/info \ + /usr/share/locale \ + /var/lib/apt/lists/* \ + /var/log/* \ + /var/cache/debconf/* \ + /etc/systemd \ + /lib/lsb \ + /lib/udev \ + /usr/lib/x86_64-linux-gnu/gconv/IBM* \ + /usr/lib/x86_64-linux-gnu/gconv/EBC* && \ + bash -c "mkdir -p /usr/share/man/man{1..8}" COPY . /app