-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
98 lines (77 loc) · 3.58 KB
/
Dockerfile
File metadata and controls
98 lines (77 loc) · 3.58 KB
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
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# syntax=docker/dockerfile:1
# check=skip=SecretsUsedInArgOrEnv
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ActiveMQ Artemis
FROM eclipse-temurin:25-jre AS builder
LABEL maintainer="Per Pascal Seeland <pascal.seeland@tik.uni-stuttgart.de"
# Make sure pipes are considered to determine success, see: https://github.com/hadolint/hadolint/wiki/DL4006
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
WORKDIR /opt
ENV ACTIVEMQ_ARTEMIS_VERSION=2.44.0
ENV ARTEMIS_USER=artemis
ENV ARTEMIS_PASSWORD=artemis
ENV ANONYMOUS_LOGIN=false
ENV CREATE_ARGUMENTS="--user ${ARTEMIS_USER} --password ${ARTEMIS_PASSWORD} --silent --http-host 0.0.0.0 --relax-jolokia"
ENV BROKER_HOME=/var/lib/artemis
ENV CONFIG_PATH=${BROKER_HOME}/etc
# add user and group for artemis
RUN apt-get -qq -o=Dpkg::Use-Pty=0 update && \
apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends \
libaio1t64 wget gpg gpg-agent&& \
rm -rf /var/lib/apt/lists/*
USER root
RUN mkdir /var/lib/artemis && chown -R ubuntu.ubuntu /var/lib/artemis
RUN wget "https://dlcdn.apache.org/activemq/activemq-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz" && \
wget "https://dlcdn.apache.org/activemq/activemq-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc" && \
wget "http://apache.org/dist/artemis/KEYS" && \
gpg --no-tty --import "KEYS" && \
gpg --no-tty "apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc" && \
tar xfz "apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz" && \
ln -s "/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}" "/opt/apache-artemis" && \
rm -f "apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz" "KEYS" "apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc";
USER ubuntu
WORKDIR /var/lib/artemis
RUN /opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis create ${CREATE_ARGUMENTS} .
FROM eclipse-temurin:25-jre
LABEL maintainer="Pascal Seeland <pascal.seeland@tik.uni-stuttgart.de>"
ENV ACTIVEMQ_ARTEMIS_VERSION=2.44.0
ENV ACTIVEMQ_ARTEMIS_VERSION=$ACTIVEMQ_ARTEMIS_VERSION
ENV BROKER_HOME=/var/lib/artemis
ENV CONFIG_PATH=${BROKER_HOME}/etc
# add user and group for artemis
RUN apt-get -qq -o=Dpkg::Use-Pty=0 update && \
apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends libaio1t64 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /var/lib/artemis && chown -R ubuntu.ubuntu /var/lib/artemis
USER ubuntu
COPY --from=builder "/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}" "/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}"
COPY --from=builder "/var/lib/artemis" "/var/lib/artemis"
# Web Server
EXPOSE 8161 \
# JMX Exporter
9404 \
# Port for AMQP
5672
WORKDIR /var/lib/artemis
COPY broker.xml etc
USER ubuntu
# Expose some outstanding folders
VOLUME ["/var/lib/artemis"]
WORKDIR /var/lib/artemis
ENTRYPOINT ["bin/artemis"]
CMD ["run"]