Page MenuHomeDevCentral

No OneTemporary

diff --git a/Dockerfile b/Dockerfile
index db03bbb..40e894c 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,20 +1,21 @@
FROM sameersbn/ubuntu:14.04.20150712
MAINTAINER sameer@damagehead.com
ENV OPENFIRE_VERSION=3.9.3 \
- OPENFIRE_USER=openfire
+ OPENFIRE_USER=openfire \
+ OPENFIRE_DATA_DIR=/data
RUN apt-get update \
&& apt-get install -y openjdk-7-jre \
&& wget "http://www.igniterealtime.org/downloadServlet?filename=openfire/openfire_${OPENFIRE_VERSION}_all.deb" \
-O /tmp/openfire_${OPENFIRE_VERSION}_all.deb \
&& dpkg -i /tmp/openfire_${OPENFIRE_VERSION}_all.deb \
&& rm -rf openfire_${OPENFIRE_VERSION}_all.deb \
&& rm -rf /var/lib/apt/lists/*
COPY entrypoint.sh /sbin/entrypoint.sh
RUN chmod 755 /sbin/entrypoint.sh
EXPOSE 3478/tcp 3479/tcp 5222/tcp 5223/tcp 5229/tcp 7070/tcp 7443/tcp 7777/tcp 9090/tcp 9091/tcp
-VOLUME ["/data"]
+VOLUME ["${OPENFIRE_DATA_DIR}"]
ENTRYPOINT ["/sbin/entrypoint.sh"]
diff --git a/entrypoint.sh b/entrypoint.sh
index 4f0f06b..2dc2d68 100755
--- a/entrypoint.sh
+++ b/entrypoint.sh
@@ -1,41 +1,41 @@
#!/bin/bash
set -e
-chmod 775 /data
+chmod 775 ${OPENFIRE_DATA_DIR}
-mkdir -p /data/openfire
-chown -R ${OPENFIRE_USER}:${OPENFIRE_USER} /data/openfire
+mkdir -p ${OPENFIRE_DATA_DIR}/openfire
+chown -R ${OPENFIRE_USER}:${OPENFIRE_USER} ${OPENFIRE_DATA_DIR}/openfire
# populate default openfire configuration if it does not exist
-if [ ! -d /data/openfire/etc ]; then
- mv /etc/openfire /data/openfire/etc
+if [ ! -d ${OPENFIRE_DATA_DIR}/openfire/etc ]; then
+ mv /etc/openfire ${OPENFIRE_DATA_DIR}/openfire/etc
fi
rm -rf /etc/openfire
-ln -sf /data/openfire/etc /etc/openfire
+ln -sf ${OPENFIRE_DATA_DIR}/openfire/etc /etc/openfire
-if [ ! -d /data/openfire/lib ]; then
- mv /var/lib/openfire /data/openfire/lib
+if [ ! -d ${OPENFIRE_DATA_DIR}/openfire/lib ]; then
+ mv /var/lib/openfire ${OPENFIRE_DATA_DIR}/openfire/lib
fi
rm -rf /var/lib/openfire
-ln -sf /data/openfire/lib /var/lib/openfire
+ln -sf ${OPENFIRE_DATA_DIR}/openfire/lib /var/lib/openfire
# allow arguments to be passed to openfire launch
if [[ ${1:0:1} = '-' ]]; then
EXTRA_ARGS="$@"
set --
fi
# default behaviour is to launch openfire
if [[ -z ${1} ]]; then
echo "Starting openfire..."
exec start-stop-daemon --start --chuid ${OPENFIRE_USER}:${OPENFIRE_USER} --exec /usr/bin/java -- \
-server \
-DopenfireHome=/usr/share/openfire \
-Dopenfire.lib.dir=/usr/share/openfire/lib \
-classpath /usr/share/openfire/lib/startup.jar \
-jar /usr/share/openfire/lib/startup.jar ${EXTRA_ARGS}
else
exec "$@"
fi

File Metadata

Mime Type
text/x-diff
Expires
Mon, Nov 25, 17:42 (11 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2260661
Default Alt Text
(2 KB)

Event Timeline