From d596b08506cc4271b8507e15af362f232ba344e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Helgi=20=C3=9Eormar=20=C3=9Eorbj=C3=B6rnsson?= Date: Tue, 27 Sep 2016 09:34:15 -0700 Subject: [PATCH] chore(Dockerfile): cleanup after installation a bit more than before and keep copyright / license files (#144) --- grafana/rootfs/Dockerfile | 42 ++++++++++++++++++++++++++++----------- 1 file changed, 30 insertions(+), 12 deletions(-) diff --git a/grafana/rootfs/Dockerfile b/grafana/rootfs/Dockerfile index 997f1b5..2b8d050 100644 --- a/grafana/rootfs/Dockerfile +++ b/grafana/rootfs/Dockerfile @@ -2,18 +2,36 @@ FROM quay.io/deis/base:v0.3.4 COPY . / -RUN apt-get update \ - && apt-get install -y libfontconfig \ - && curl -sL -o /usr/share/grafana/envtpl https://github.com/arschles/envtpl/releases/download/0.2.3/envtpl_linux_amd64 \ - && chmod +x /usr/share/grafana/envtpl \ - && curl -so /tmp/grafana.deb https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.0-1468321182_amd64.deb \ - && dpkg -i /tmp/grafana.deb \ - && rm /tmp/grafana.deb \ - && rm /etc/grafana/grafana.ini \ - && chmod +x /usr/share/grafana/start-grafana \ - && chmod 644 /usr/share/grafana/grafana.ini.tpl \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* /usr/share/man /usr/share/doc +RUN apt-get update && \ + apt-get install -y libfontconfig && \ + curl -sL -o /usr/share/grafana/envtpl https://github.com/arschles/envtpl/releases/download/0.2.3/envtpl_linux_amd64 && \ + chmod +x /usr/share/grafana/envtpl && \ + curl -so /tmp/grafana.deb https://grafanarel.s3.amazonaws.com/builds/grafana_3.1.0-1468321182_amd64.deb && \ + dpkg -i /tmp/grafana.deb && \ + rm /tmp/grafana.deb && \ + rm /etc/grafana/grafana.ini && \ + chmod +x /usr/share/grafana/start-grafana && \ + chmod 644 /usr/share/grafana/grafana.ini.tpl && \ + # cleanup + 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}" WORKDIR /usr/share/grafana CMD ["./start-grafana"]