-
-
Notifications
You must be signed in to change notification settings - Fork 483
/
Dockerfile.jetty-alpine
76 lines (63 loc) · 2.25 KB
/
Dockerfile.jetty-alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM maven:3-eclipse-temurin-17-alpine AS builder
COPY pom.xml pom.parent.xml /app/
COPY src/main /app/src/main/
WORKDIR /app
RUN mvn --batch-mode --define java.net.useSystemProxies=true package
########################################################################################
FROM jetty:11.0.18-jre17-alpine-eclipse-temurin
# 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
USER root
RUN apk add --no-cache \
curl \
font-noto-cjk \
libgd \
&& \
/generate-jetty-start.sh
#RUN apk add --no-cache graphviz
ARG GRAPHVIZ_VERSION
ARG GRAPHVIZ_BUILD_DIR=/tmp/graphiz-build
RUN apk add --no-cache \
g++ \
jq \
expat-dev \
make \
zlib \
pkgconf \
&& \
mkdir -p $GRAPHVIZ_BUILD_DIR && \
cd $GRAPHVIZ_BUILD_DIR && \
GRAPHVIZ_VERSION=${GRAPHVIZ_VERSION:-$(curl -s https://gitlab.com/api/v4/projects/4207231/releases/ | jq -r '.[] | .name' | sort -V -r | head -1)} && \
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 && \
apk del --no-cache \
g++ \
jq \
expat-dev \
make \
zlib \
&& \
rm -rf $GRAPHVIZ_BUILD_DIR
COPY docker-entrypoint.jetty.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
USER jetty
ENV WEBAPP_PATH=$JETTY_BASE/webapps
RUN rm -rf $WEBAPP_PATH && \
mkdir -p $WEBAPP_PATH
COPY --from=builder /app/target/plantuml.war /plantuml.war
COPY ROOT.jetty.xml $WEBAPP_PATH/ROOT.xml
# Openshift https://docs.openshift.com/container-platform/4.9/openshift_images/create-images.html#images-create-guide-openshift_create-images
USER root
RUN chgrp -R 0 $JETTY_BASE && \
chmod -R g=u $JETTY_BASE
RUN chgrp -R 0 /tmp && \
chmod -R g=u /tmp
USER jetty
ENTRYPOINT ["/entrypoint.sh"]
VOLUME ["/tmp/jetty"]