From 7fb25caeca6ca10a4200017dea820543527af80f Mon Sep 17 00:00:00 2001 From: David Ducatel Date: Wed, 13 Dec 2017 10:31:39 +0100 Subject: [PATCH] Fix docker build problem on jetty --- .travis.yml | 6 +++--- Dockerfile.jetty | 10 ++++++++-- Dockerfile.tomcat | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/.travis.yml b/.travis.yml index c8dcc9c..3f47d91 100644 --- a/.travis.yml +++ b/.travis.yml @@ -9,15 +9,15 @@ after_success: - docker login -u $DOCKER_LOGIN -p $DOCKER_PASSWORD - if [ "$TRAVIS_BRANCH" == "master" ]; then - docker build -t plantuml/plantuml-server:jetty -f Dockerfile.jetty . ; - docker build -t plantuml/plantuml-server:tomcat -f Dockerfile.tomcat . ; + docker build --pull -t plantuml/plantuml-server:jetty -f Dockerfile.jetty . ; + docker build --pull -t plantuml/plantuml-server:tomcat -f Dockerfile.tomcat . ; docker tag plantuml/plantuml-server:jetty plantuml/plantuml-server:latest ; docker push plantuml/plantuml-server:tomcat; docker push plantuml/plantuml-server:jetty; docker push plantuml/plantuml-server:latest; - docker build -t plantuml/plantuml-server:armv8a -f Dockerfile.armv8a . ; + docker build --pull -t plantuml/plantuml-server:armv8a -f Dockerfile.armv8a . ; docker push plantuml/plantuml-server:armv8a; fi diff --git a/Dockerfile.jetty b/Dockerfile.jetty index 93bd2a6..e71f144 100644 --- a/Dockerfile.jetty +++ b/Dockerfile.jetty @@ -1,6 +1,8 @@ FROM maven:3-jdk-8 AS builder -RUN apt-get update && apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && rm -rf /var/lib/apt/lists/* +RUN apt-get update && \ + apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && \ + apt-get clean COPY pom.xml /app/ COPY src /app/src/ @@ -14,9 +16,13 @@ RUN mvn package FROM jetty MAINTAINER D.Ducatel +USER root + RUN apt-get update && \ apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && \ - rm -rf /var/lib/apt/lists/* + apt-get clean + +USER jetty COPY --from=builder /app/target/plantuml.war /var/lib/jetty/webapps/ROOT.war diff --git a/Dockerfile.tomcat b/Dockerfile.tomcat index 4542bec..7d4b20d 100644 --- a/Dockerfile.tomcat +++ b/Dockerfile.tomcat @@ -1,6 +1,8 @@ FROM maven:3-jdk-8 AS builder -RUN apt-get update && apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && rm -rf /var/lib/apt/lists/* +RUN apt-get update && \ + apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && \ + apt-get clean COPY pom.xml /app/ COPY src /app/src/ @@ -16,7 +18,7 @@ MAINTAINER D.Ducatel RUN apt-get update && \ apt-get install -y --no-install-recommends graphviz fonts-wqy-zenhei && \ - rm -rf /var/lib/apt/lists/* + apt-get clean RUN rm -rf /usr/local/tomcat/webapps/ROOT COPY --from=builder /app/target/plantuml.war /usr/local/tomcat/webapps/ROOT.war