From f9dcbeb15f221faddc28d4ab188bb408dc3e20fe Mon Sep 17 00:00:00 2001 From: kazk Date: Wed, 3 Aug 2022 00:08:49 -0700 Subject: [PATCH] Reduce image size --- Dockerfile | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0727eb0..e1121a5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,29 +1,22 @@ FROM docker.io/library/ubuntu:22.04 RUN set -ex; \ + buildDeps='g++ make cmake wget ca-certificates'; \ apt-get update; \ apt-get install -y --no-install-recommends \ gcc \ - g++ \ - make \ - cmake \ - wget \ - ca-certificates \ + $buildDeps \ ; \ - apt-get autoremove -y; \ - apt-get clean; \ - rm -rf /var/lib/apt/lists/*; - -RUN set -ex; \ cd /tmp; \ + mkdir -p /tmp/cgreen; \ wget https://github.com/cgreen-devs/cgreen/archive/refs/tags/1.6.0.tar.gz; \ - tar xvf 1.6.0.tar.gz; \ - rm -vf 1.6.0.tar.gz; \ - cd cgreen-1.6.0; \ - make; \ - make install; \ - cd ..; \ - rm -rvf /tmp/cgreen-1.6.0; + tar -xzf 1.6.0.tar.gz -C /tmp/cgreen --strip-components=1; \ + rm 1.6.0.tar.gz; \ + make -C /tmp/cgreen; \ + make -C /tmp/cgreen install; \ + apt-get purge -y --auto-remove $buildDeps; \ + apt-get clean; \ + rm -rf /var/lib/apt/lists/* /tmp/*; ENV LD_LIBRARY_PATH=/usr/local/lib