From db99ef84ee9ba4ef28217a32436afa86c31a5ad1 Mon Sep 17 00:00:00 2001 From: Daniel Chabrowski Date: Tue, 20 Aug 2019 11:18:19 +0200 Subject: [PATCH] Reduce size of docker image (#217) --- Dockerfile | 42 +++++++++++++++++++----------------------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/Dockerfile b/Dockerfile index 6919cb28..5c8c60a9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,31 +1,27 @@ FROM ubuntu:18.04 -RUN apt-get update -yqq && \ - apt-get install -yqq --no-install-recommends software-properties-common && \ - apt-get install -yqq --no-install-recommends sudo curl wget cmake locales git \ - openssl libssl-dev libjsoncpp-dev uuid-dev zlib1g-dev -RUN apt-get install -yqq --no-install-recommends postgresql-server-dev-all -RUN apt-get install -yqq --no-install-recommends libmariadbclient-dev -RUN apt-get install -yqq --no-install-recommends libsqlite3-dev -RUN apt-get install -yqq --no-install-recommends gcc-8 g++-8 +RUN apt-get update -yqq \ + && apt-get install -yqq --no-install-recommends software-properties-common \ + sudo curl wget cmake locales git gcc-8 g++-8 \ + openssl libssl-dev libjsoncpp-dev uuid-dev zlib1g-dev \ + postgresql-server-dev-all libmariadbclient-dev libsqlite3-dev \ + && rm -rf /var/lib/apt/lists/* \ + && locale-gen en_US.UTF-8 -RUN locale-gen en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 +ENV LANG=en_US.UTF-8 \ + LANGUAGE=en_US:en \ + LC_ALL=en_US.UTF-8 \ + CC=gcc-8 \ + CXX=g++-8 \ + AR=gcc-ar-8 \ + RANLIB=gcc-ranlib-8 \ + IROOT=/install -ENV CC=gcc-8 -ENV CXX=g++-8 -ENV AR=gcc-ar-8 -ENV RANLIB=gcc-ranlib-8 +ENV DROGON_ROOT="$IROOT/drogon" -ENV IROOT=/install -ENV DROGON_ROOT=$IROOT/drogon - -WORKDIR $IROOT -ADD https://api.github.com/repos/an-tao/drogon/git/refs/heads/master version.json -RUN git clone https://github.com/an-tao/drogon +ADD https://api.github.com/repos/an-tao/drogon/git/refs/heads/master $IROOT/version.json +RUN git clone https://github.com/an-tao/drogon $DROGON_ROOT WORKDIR $DROGON_ROOT -RUN ./build.sh +RUN ./build.sh