-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
38 lines (28 loc) · 1.4 KB
/
Dockerfile
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
# Inspired by https://github.com/fabric8io-images/java/blob/master/images/alpine/openjdk11/jre/Dockerfile
FROM eclipse-temurin:11-jre
# JAVA_APP_DIR is used by run-java.sh for finding the binaries
ENV JAVA_APP_DIR=/deployments \
JAVA_MAJOR_VERSION=11
# /dev/urandom is used as random source, which is perfectly safe
# according to http://www.2uo.de/myths-about-urandom/
RUN echo "securerandom.source=file:/dev/urandom" >>/opt/java/openjdk/conf/security/java.security
# Agent bond including Jolokia and jmx_exporter
COPY docker/agent-bond-opts /opt/run-java-options
RUN mkdir -p /opt/agent-bond && \
curl https://repo.maven.apache.org/maven2/io/fabric8/agent-bond-agent/1.2.0/agent-bond-agent-1.2.0.jar -o /opt/agent-bond/agent-bond.jar && \
chmod 444 /opt/agent-bond/agent-bond.jar && \
chmod 755 /opt/run-java-options
COPY docker/jmx_exporter_config.yml /opt/agent-bond/
EXPOSE 8778 9779
# Install helm
COPY --from=alpine/helm:3.11.3 /usr/bin/helm /usr/bin/helm
# Set ENV vars
ENV JAVA_OPTIONS="-Doperator.charts.path=helm -Djava.util.logging.manager=org.jboss.logmanager.LogManager" \
AB_ENABLED=jmx_exporter
# Add run script as /deployments/run-java.sh
COPY docker/run-java.sh /deployments/
# Copy helm charts
COPY --chown=1000:1000 java-operator/src/main/helm /deployments/helm/
# Copy build target
COPY --chown=1000:1000 java-operator/build/quarkus-app /deployments/
CMD [ "/deployments/run-java.sh" ]