-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
101 lines (79 loc) · 3.97 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
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
99
100
101
# 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 openjdk:11 as builder
LABEL maintainer="Per Pascal Seeland <[email protected]"
# 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.23.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 groupadd --gid 1000 -r artemis && useradd -r -u 1000 -g artemis artemis \
&& apt-get -qq -o=Dpkg::Use-Pty=0 update && \
apt-get -qq -o=Dpkg::Use-Pty=0 install -y --no-install-recommends \
libaio1 wget && \
rm -rf /var/lib/apt/lists/*
USER root
RUN mkdir /var/lib/artemis && chown -R artemis.artemis /var/lib/artemis
RUN wget "https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz" && \
wget "https://repository.apache.org/content/repositories/releases/org/apache/activemq/apache-artemis/${ACTIVEMQ_ARTEMIS_VERSION}/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}-bin.tar.gz.asc" && \
wget "http://apache.org/dist/activemq/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";
RUN rm -r /opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/web/{api,examples,user-manual,hacking-guide,migration-guide} && rm -r /opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/examples
USER artemis
WORKDIR /var/lib/artemis
RUN /opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}/bin/artemis create ${CREATE_ARGUMENTS} .
FROM eclipse-temurin:11-jre
LABEL maintainer="Pascal Seeland <[email protected]>"
ENV ACTIVEMQ_ARTEMIS_VERSION 2.23.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 addgroup --gid 1000 --system artemis && adduser -u 1000 --system --ingroup artemis artemis \
&& apt-get -qq -o=Dpkg::Use-Pty=0 update && \
apt-get -qq -o=Dpkg::Use-Pty=0 install -y libaio1 && \
rm -rf /var/lib/apt/lists/*
RUN mkdir /var/lib/artemis && chown -R artemis.artemis /var/lib/artemis
USER artemis
COPY --from=builder "/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}" "/opt/apache-artemis-${ACTIVEMQ_ARTEMIS_VERSION}"
COPY --from=builder "/var/lib/artemis" "/var/lib/artemis"
#COPY --from=builder "/opt/jmx-exporter" "/opt/jmx-exporter"
# Web Server
EXPOSE 8161 \
# JMX Exporter
9404 \
# Port for AMQP
5672
WORKDIR /var/lib/artemis
COPY broker.xml etc
USER artemis
# Expose some outstanding folders
VOLUME ["/var/lib/artemis"]
WORKDIR /var/lib/artemis
ENTRYPOINT ["bin/artemis"]
CMD ["run"]