mirror of
https://github.com/octoleo/plantuml-server.git
synced 2024-12-22 08:48:54 +00:00
04af2a25d2
Also manually cleaned up `/var/lib/apt/lists` in original commits but got conflict with #97, then removed. Ref: https://docs.docker.com/develop/develop-images/dockerfile_best-practices/ > In addition, when you clean up the apt cache by removing > /var/lib/apt/lists it reduces the image size, since the apt cache is not > stored in a layer. > Official Debian and Ubuntu images automatically run apt-get clean, > so explicit invocation is not required.
44 lines
1.4 KiB
Docker
44 lines
1.4 KiB
Docker
FROM maven:3-jdk-11 AS buildertomcat
|
|
|
|
COPY pom.xml /app/
|
|
COPY src /app/src/
|
|
|
|
WORKDIR /app
|
|
RUN mvn --batch-mode --define java.net.useSystemProxies=true package
|
|
|
|
########################################################################################
|
|
|
|
FROM tomcat:9.0-jdk11-openjdk-slim as graphviz
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y wget binutils gcc make ghostscript groff g++ fontconfig fontconfig-config fonts-dejavu-core fonts-noto-cjk file libexpat1-dev libcairo2-dev libpango1.0-dev
|
|
|
|
RUN mkdir /root/build && \
|
|
cd /root/build && \
|
|
wget -O - https://www2.graphviz.org/Packages/stable/portable_source/graphviz-2.44.1.tar.gz | gzip -d | tar xvf - && \
|
|
cd graphviz-2.44.1 && \
|
|
./configure --prefix /usr && \
|
|
make -j 4 && \
|
|
make DESTDIR=/root/install/ install-strip
|
|
|
|
########################################################################################
|
|
|
|
FROM tomcat:9.0-jdk11-openjdk-slim
|
|
MAINTAINER D.Ducatel
|
|
|
|
RUN apt-get update && \
|
|
apt-get install -y --no-install-recommends fonts-noto-cjk libexpat1 libcairo2 libpango1.0 libpangoft2-1.0 libpangocairo-1.0 && \
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
ENV GRAPHVIZ_DOT=/usr/bin/dot
|
|
|
|
ARG BASE_URL=ROOT
|
|
RUN rm -rf /usr/local/tomcat/webapps/$BASE_URL
|
|
COPY --from=buildertomcat /app/target/plantuml.war /usr/local/tomcat/webapps/$BASE_URL.war
|
|
|
|
COPY --from=graphviz /root/install/usr/bin/dot /usr/bin/
|
|
COPY --from=graphviz /root/install/usr/lib/ /usr/lib/
|
|
|
|
RUN dot -c
|
|
|