forked from M3hran/docker-activemq
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
64 lines (64 loc) · 1.9 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
+FROM m3hran/baseimage
+MAINTAINER Martin Taheri <[email protected]>
+
+
+ENV ACTIVEMQ_VERSION 5.14.4
+ENV ACTIVEMQ_HOME /u/apps/activemq
+ENV ACTIVEMQ_DATA_DIR /u/data/activemq
+ENV ACTIVEMQ_LOG_DIR /var/log/activemq
+
+RUN clean_install.sh python-testtools python-nose python-pip logrotate locales \
+ && update-locale LANG=C.UTF-8 LC_MESSAGES=POSIX \
+ && locale-gen en_US.UTF-8 \
+ && dpkg-reconfigure locales
+
+RUN pip install stomp.py
+
+# Install activemq
+RUN mkdir -p ${ACTIVEMQ_HOME} \
+ && cd /usr/src \
+ && wget http://apache.mirrors.ovh.net/ftp.apache.org/dist/activemq/${ACTIVEMQ_VERSION}/apache-activemq-${ACTIVEMQ_VERSION}-bin.tar.gz \
+ && tar -xvzf apache-activemq-${ACTIVEMQ_VERSION}-bin.tar.gz \
+ && mv apache-activemq-${ACTIVEMQ_VERSION}/* ${ACTIVEMQ_HOME} \
+ && rm -rf /usr/src/*
+
+RUN mkdir -p ${ACTIVEMQ_DATA_DIR} \
+ && mkdir -p ${ACTIVEMQ_LOG_DIR} \
+ && groupadd activemq \
+ && useradd --system --home ${ACTIVEMQ_HOME} -g activemq activemq \
+ && chown -R activemq:activemq ${ACTIVEMQ_HOME} \
+ && chown -R activemq:activemq ${ACTIVEMQ_DATA_DIR} \
+ && chown -R activemq:activemq ${ACTIVEMQ_LOG_DIR}
+
+# Setup logrotate for activemq
+RUN echo \
+ ${ACTIVEMQ_LOG_DIR}/activemq/*.log { \n\
+ su activemq activemq \n\
+ daily \n\
+ missingok \n\
+ rotate 10 \n\
+ compress \n\
+ copytruncate \n\
+ dateext \n\
+ dateformat -%Y-%m-%d \n\
+ }\
+ >> /etc/logrotate.d/activemq
+
+# Startup activemq with the container
+COPY bin/activemq_start.sh /etc/my_init.d/activemq_start.sh
+RUN chmod +x /etc/my_init.d/activemq_start.sh
+
+WORKDIR /u/apps
+
+# Expose all ports
+EXPOSE 8161
+EXPOSE 61616
+EXPOSE 5672
+EXPOSE 61613
+EXPOSE 1883
+EXPOSE 61614
+
+# Expose some folders
+#VOLUME ["/u/data/activemq"]
+#VOLUME ["/var/log/activemq"]
+#VOLUME ["/u/opt/activemq/conf"]