From 39a1e6660ecfa5a102b00ca305ebf929821f7214 Mon Sep 17 00:00:00 2001 From: Zaoqi Date: Tue, 17 Dec 2019 21:34:21 +0800 Subject: [PATCH] Dockerfile: correct `apt clean` + git clone --depth 1 + remove .git (#8697) --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 27734119e..c465be14a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,7 @@ FROM debian:stretch USER root RUN apt-get update -y && \ apt-get -y install build-essential libirrlicht-dev cmake libbz2-dev libpng-dev libjpeg-dev \ - libsqlite3-dev libcurl4-gnutls-dev zlib1g-dev libgmp-dev libjsoncpp-dev git && \ - apt-get clean && rm -rf /var/cache/apt/archives/* && \ - rm -rf /var/lib/apt/lists/* + libsqlite3-dev libcurl4-gnutls-dev zlib1g-dev libgmp-dev libjsoncpp-dev git COPY . /usr/src/minetest @@ -16,7 +14,8 @@ RUN mkdir -p /usr/src/minetest/cmakebuild && cd /usr/src/minetest/cmakebuild && -DENABLE_SYSTEM_JSONCPP=1 \ .. && \ make -j2 && \ - rm -Rf ../games/minetest_game && git clone https://github.com/minetest/minetest_game ../games/minetest_game && \ + rm -Rf ../games/minetest_game && git clone --depth 1 https://github.com/minetest/minetest_game ../games/minetest_game && \ + rm -Rf ../games/minetest_game/.git make install FROM debian:stretch @@ -25,7 +24,9 @@ USER root RUN groupadd minetest && useradd -m -g minetest -d /var/lib/minetest minetest && \ apt-get update -y && \ apt-get -y install libcurl3-gnutls libjsoncpp1 liblua5.1-0 libluajit-5.1-2 libpq5 libsqlite3-0 \ - libstdc++6 zlib1g libc6 + libstdc++6 zlib1g libc6 && \ + apt-get clean && rm -rf /var/cache/apt/archives/* && \ + rm -rf /var/lib/apt/lists/* WORKDIR /var/lib/minetest -- 2.25.1