From 73cbebcd9f41e939bdcab4e3a386cc232400564d Mon Sep 17 00:00:00 2001 From: Lukas Forst Date: Sat, 21 Mar 2020 19:04:45 +0100 Subject: [PATCH] Do not download dockerize, use docker caches - fixes #136 (#148) --- docker/Dockerfile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 00b01670f..52aef406e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,14 +1,19 @@ FROM openjdk:8-jre-alpine VOLUME /tmp -ARG DOCKERIZE_VERSION -ARG ARTIFACT_NAME -ARG EXPOSED_PORT -ENV SPRING_PROFILES_ACTIVE docker -ADD https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz dockerize.tar.gz +# Download dockerize and cache that layer +ARG DOCKERIZE_VERSION +RUN wget -O dockerize.tar.gz https://github.com/jwilder/dockerize/releases/download/${DOCKERIZE_VERSION}/dockerize-alpine-linux-amd64-${DOCKERIZE_VERSION}.tar.gz RUN tar xzf dockerize.tar.gz RUN chmod +x dockerize + +# This is the first layer that won't be cached +ARG ARTIFACT_NAME ADD ${ARTIFACT_NAME}.jar /app.jar -RUN touch /app.jar + +ARG EXPOSED_PORT EXPOSE ${EXPOSED_PORT} + +ENV SPRING_PROFILES_ACTIVE docker + ENTRYPOINT ["java", "-XX:+UnlockExperimentalVMOptions", "-XX:+UseCGroupMemoryLimitForHeap", "-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]