From a01c1c96fe9a61044216dfca1803e2edbcbdb8a3 Mon Sep 17 00:00:00 2001 From: Martin Lablans Date: Tue, 9 Mar 2021 14:54:38 +0100 Subject: [PATCH] In Docker image, restore MANIFEST.MF, pom.xml, pom.properties --- .dockerignore | 2 +- Dockerfile | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.dockerignore b/.dockerignore index 6cbb02a0..fc364604 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,4 @@ * !src/docker -!target/connector/ +!target/connector.war !Dockerfile diff --git a/Dockerfile b/Dockerfile index 2bc29934..cf5915fd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,14 @@ ARG TOMCAT_IMAGE_VERSION=9-jdk8-openjdk-slim + +FROM alpine:latest as extract + +RUN apk add --no-cache unzip + +ADD target/connector.war /connector/connector.war + +RUN mkdir -p /connector/extracted && \ + unzip /connector/connector.war -d /connector/extracted/ + FROM tomcat:$TOMCAT_IMAGE_VERSION ## Define for which project this image is build @@ -7,7 +17,7 @@ ENV PROJECT=$PROJECT RUN ["rm", "-fr", "/usr/local/tomcat/webapps"] -COPY target/connector/ /usr/local/tomcat/webapps/ROOT/ +COPY --from=extract /connector/extracted/ /usr/local/tomcat/webapps/ROOT/ # Adding fontconfig and libfreetype6 for rendering the BK Export, cf. https://stackoverflow.com/questions/55454036 RUN apt-get update && apt-get install -y fontconfig libfreetype6 && \