-
Notifications
You must be signed in to change notification settings - Fork 11
/
Dockerfile
40 lines (30 loc) · 1.46 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
FROM openjdk:8-jre-alpine
ENV ACTIVEMQ_VERSION 5.15.4
ENV ACTIVEMQ apache-activemq-$ACTIVEMQ_VERSION
ENV ACTIVEMQ_TCP=61616 ACTIVEMQ_AMQP=5672 ACTIVEMQ_STOMP=61613 ACTIVEMQ_MQTT=1883 ACTIVEMQ_WS=61614 ACTIVEMQ_UI=8161
ENV SHA512_VAL=26d8154fcfe17ab90508b3b9d46b40815404fa3886cfdc4eae4b06086332203bd2455475b9309ccabd76d0c9b65f523f9d3911d315c17bf4b48bd22395ea8ead
ENV ACTIVEMQ_HOME /opt/activemq
ENV K8S_HOST_NAME localmachine
RUN set -x && \
mkdir -p /opt && \
apk --update add --virtual build-dependencies curl && \
curl https://archive.apache.org/dist/activemq/$ACTIVEMQ_VERSION/$ACTIVEMQ-bin.tar.gz -o $ACTIVEMQ-bin.tar.gz
# Validate checksum
RUN if [ "$SHA512_VAL" != "$(sha512sum $ACTIVEMQ-bin.tar.gz | awk '{print($1)}')" ];\
then \
echo "sha512 values doesn't match! exiting." && \
exit 1; \
fi;
RUN tar xzf $ACTIVEMQ-bin.tar.gz -C /opt && \
ln -s /opt/$ACTIVEMQ $ACTIVEMQ_HOME && \
addgroup -S activemq && adduser -S -H -G activemq -h $ACTIVEMQ_HOME activemq
ADD lib/activemq-k8s-discovery-1.0.2-jar-with-dependencies.jar $ACTIVEMQ_HOME/lib/
ADD conf/activemq.xml $ACTIVEMQ_HOME/conf/
RUN chown -R activemq:activemq /opt/$ACTIVEMQ && \
chown -h activemq:activemq $ACTIVEMQ_HOME && \
apk del build-dependencies && \
rm -rf /var/cache/apk/*
USER activemq
WORKDIR $ACTIVEMQ_HOME
EXPOSE $ACTIVEMQ_TCP $ACTIVEMQ_AMQP $ACTIVEMQ_STOMP $ACTIVEMQ_MQTT $ACTIVEMQ_WS $ACTIVEMQ_UI
CMD ["/bin/sh", "-c", "bin/activemq console"]