From eef65877b128fc244762a7057d13ff1138527cd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Sch=C3=A4rtl?= <andreas@schaertl.me> Date: Tue, 3 Nov 2020 14:16:23 +0000 Subject: [PATCH] app: switch to multi stage build Mind you, the image is still about 240M in size. These Java images don't really get much smaller. --- src/ulo-storage-applications/Dockerfile | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/ulo-storage-applications/Dockerfile b/src/ulo-storage-applications/Dockerfile index 81bcee6..50195a1 100644 --- a/src/ulo-storage-applications/Dockerfile +++ b/src/ulo-storage-applications/Dockerfile @@ -1,15 +1,13 @@ FROM openjdk:11 - +RUN apt update && apt install -y maven +RUN git clone https://gl.kwarc.info/supervision/schaertl_andreas +WORKDIR /schaertl_andreas/src/ulo-storage-applications/ +RUN mvn install + +FROM alpine:latest +RUN apk --no-cache add openjdk11 +WORKDIR / +COPY --from=0 /schaertl_andreas/src/ulo-storage-applications/target/uloapi-0.1-jar-with-dependencies.jar /opt/ COPY ./target/uloapi-0.1-jar-with-dependencies.jar /opt/ - -# -# set the following ENV variables to configure the application -# to work with your existing setup -# - -#ENV ULO_SERVER=http://rdf:7200/ -#ENV ULO_REPOSITORY=compose - EXPOSE 7400 - CMD ["java", "-jar", "/opt/uloapi-0.1-jar-with-dependencies.jar"] -- GitLab