2023-05-05 20:15:52 +00:00
FROM maven:3-eclipse-temurin-11 AS builder
2017-10-20 18:20:26 +00:00
COPY pom.xml /app/
2021-10-11 15:33:30 +00:00
COPY src/main /app/src/main/
2017-10-20 18:20:26 +00:00
WORKDIR /app
2018-11-15 12:53:00 +00:00
RUN mvn --batch-mode --define java.net.useSystemProxies= true package
2017-10-20 18:20:26 +00:00
########################################################################################
2023-05-05 20:15:52 +00:00
FROM jetty:11.0.15-jre11
2021-10-15 13:11:55 +00:00
# Proxy and OldProxy need empty path segments support in URIs
# Hence: allow AMBIGUOUS_EMPTY_SEGMENT
# Changes are only active if `/generate-jetty-start.sh` is called!
RUN sed -i 's/# jetty\.httpConfig\.uriCompliance=DEFAULT/jetty.httpConfig.uriCompliance=DEFAULT,AMBIGUOUS_EMPTY_SEGMENT/g' /var/lib/jetty/start.d/server.ini
2017-04-28 08:53:11 +00:00
2017-12-13 09:31:39 +00:00
USER root
2023-05-05 20:15:52 +00:00
2017-04-28 08:53:11 +00:00
RUN apt-get update && \
2021-10-11 15:33:30 +00:00
apt-get install -y --no-install-recommends \
2023-05-05 20:15:52 +00:00
curl \
2021-10-11 15:33:30 +00:00
fonts-noto-cjk \
2023-03-29 13:02:45 +00:00
libgd3 \
2021-10-11 15:33:30 +00:00
&& \
rm -rf /var/lib/apt/lists/* && \
2021-05-12 21:25:31 +00:00
/generate-jetty-start.sh
2017-12-13 09:31:39 +00:00
2023-03-29 14:02:48 +00:00
# Build Graphviz from source because there are no binary distributions for recent versions
2023-05-05 15:38:28 +00:00
ARG GRAPHVIZ_VERSION
2023-03-29 12:26:08 +00:00
ARG GRAPHVIZ_BUILD_DIR = /tmp/graphiz-build
2023-03-29 13:02:45 +00:00
RUN apt-get update && \
apt-get install -y --no-install-recommends \
build-essential \
2023-05-05 15:38:28 +00:00
jq \
2023-04-11 11:19:11 +00:00
libexpat1-dev \
2023-04-11 15:00:29 +00:00
libgd-dev \
zlib1g-dev \
2023-03-29 13:02:45 +00:00
&& \
mkdir -p $GRAPHVIZ_BUILD_DIR && \
2023-03-29 12:26:08 +00:00
cd $GRAPHVIZ_BUILD_DIR && \
2023-05-05 15:38:28 +00:00
GRAPHVIZ_VERSION = ${ GRAPHVIZ_VERSION :- $( curl -s https://gitlab.com/api/v4/projects/4207231/releases/ | jq -r '.[] | .name' | sort -V -r | head -1) } && \
2023-03-29 12:26:08 +00:00
curl -o graphviz.tar.gz https://gitlab.com/api/v4/projects/4207231/packages/generic/graphviz-releases/${ GRAPHVIZ_VERSION } /graphviz-${ GRAPHVIZ_VERSION } .tar.gz && \
tar -xzf graphviz.tar.gz && \
cd graphviz-$GRAPHVIZ_VERSION && \
./configure && \
make && \
make install && \
2023-04-11 15:00:29 +00:00
apt-get remove -y \
build-essential \
2023-05-05 15:38:28 +00:00
jq \
2023-04-11 15:00:29 +00:00
libexpat1-dev \
libgd-dev \
zlib1g-dev \
&& \
2023-05-05 20:15:52 +00:00
apt-get autoremove -y && \
2023-05-17 17:13:46 +00:00
apt-get clean && \
2023-03-29 13:02:45 +00:00
rm -rf /var/lib/apt/lists/* && \
2023-03-29 12:26:08 +00:00
rm -rf $GRAPHVIZ_BUILD_DIR
2023-01-25 15:35:10 +00:00
COPY docker-entrypoint.jetty.sh /entrypoint.sh
2021-10-11 15:33:30 +00:00
RUN chmod +x /entrypoint.sh
2017-12-13 09:31:39 +00:00
USER jetty
2017-04-28 08:53:11 +00:00
2023-01-25 15:35:10 +00:00
ENV WEBAPP_PATH = $JETTY_BASE /webapps
2021-10-11 15:33:30 +00:00
RUN rm -rf $WEBAPP_PATH && \
mkdir -p $WEBAPP_PATH
2023-01-25 15:35:10 +00:00
COPY --from= builder /app/target/plantuml.war /plantuml.war
COPY ROOT.jetty.xml $WEBAPP_PATH /ROOT.xml
2018-11-15 12:59:52 +00:00
2022-11-07 11:33:47 +00:00
# Openshift https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-guide-openshift_create-images
2023-05-05 15:50:02 +00:00
USER root
2022-11-07 11:33:47 +00:00
RUN chgrp -R 0 $JETTY_BASE && chmod -R g = u $JETTY_BASE
RUN chgrp -R 0 /tmp && chmod -R g = u /tmp
2022-11-07 11:34:37 +00:00
USER jetty
2023-03-08 13:01:25 +00:00
2023-05-05 20:15:52 +00:00
ENTRYPOINT [ "/entrypoint.sh" ]
2023-03-08 13:01:25 +00:00
VOLUME [ "/tmp/jetty" ]