summaryrefslogtreecommitdiffstats
path: root/src/main/docker/Dockerfile
diff options
context:
space:
mode:
authorsunil unnava <sunil.unnava@att.com>2018-11-20 14:43:42 -0500
committersunil unnava <sunil.unnava@att.com>2018-11-20 14:46:49 -0500
commit5e3d91f7a9a7bb260cbe6bd204e6bd2afb05a8bc (patch)
treeb7002057bdbe6647942aa3c58e68060d79410eea /src/main/docker/Dockerfile
parent690f3fad96b748745e016ad48b78ea17a1872ec3 (diff)
creates the Zookeeper image
Change-Id: I79153cd5f89bb1897c3ec11a96113604378aacee Issue-ID: DMAAP-888 Signed-off-by: sunil unnava <sunil.unnava@att.com>
Diffstat (limited to 'src/main/docker/Dockerfile')
-rw-r--r--src/main/docker/Dockerfile55
1 files changed, 55 insertions, 0 deletions
diff --git a/src/main/docker/Dockerfile b/src/main/docker/Dockerfile
new file mode 100644
index 0000000..905b27d
--- /dev/null
+++ b/src/main/docker/Dockerfile
@@ -0,0 +1,55 @@
+FROM ubuntu:16.04
+ENV ZK_USER=zookeeper \
+ZK_DATA_DIR=/var/lib/zookeeper/data \
+ZK_DATA_LOG_DIR=/var/lib/zookeeper/log \
+ZK_LOG_DIR=/var/log/zookeeper \
+JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
+
+ARG GPG_KEY=C823E3E5B12AF29C67F81976F5CECB3CB5E9BD2D
+ARG ZK_DIST=zookeeper-3.4.10
+RUN set -x \
+ && apt-get update \
+ && apt-get install -y openjdk-8-jre-headless wget netcat-openbsd \
+ && wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz" \
+ && wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz.asc" \
+ && export GNUPGHOME="$(mktemp -d)" \
+ && gpg --keyserver ha.pool.sks-keyservers.net --recv-key "$GPG_KEY" \
+ && gpg --batch --verify "$ZK_DIST.tar.gz.asc" "$ZK_DIST.tar.gz" \
+ && tar -xzf "$ZK_DIST.tar.gz" -C /opt \
+ && rm -r "$GNUPGHOME" "$ZK_DIST.tar.gz" "$ZK_DIST.tar.gz.asc" \
+ && ln -s /opt/$ZK_DIST /opt/zookeeper \
+ && rm -rf /opt/zookeeper/CHANGES.txt \
+ /opt/zookeeper/README.txt \
+ /opt/zookeeper/NOTICE.txt \
+ /opt/zookeeper/CHANGES.txt \
+ /opt/zookeeper/README_packaging.txt \
+ /opt/zookeeper/build.xml \
+ /opt/zookeeper/config \
+ /opt/zookeeper/contrib \
+ /opt/zookeeper/dist-maven \
+ /opt/zookeeper/docs \
+ /opt/zookeeper/ivy.xml \
+ /opt/zookeeper/ivysettings.xml \
+ /opt/zookeeper/recipes \
+ /opt/zookeeper/src \
+ /opt/zookeeper/$ZK_DIST.jar.asc \
+ /opt/zookeeper/$ZK_DIST.jar.md5 \
+ /opt/zookeeper/$ZK_DIST.jar.sha1 \
+ && apt-get autoremove -y wget \
+ && rm -rf /var/lib/apt/lists/*
+
+#Copy configuration generator script to bin
+COPY scripts /opt/zookeeper/bin/
+
+# Create a user for the zookeeper process and configure file system ownership
+# for nessecary directories and symlink the distribution as a user executable
+RUN set -x \
+ && useradd $ZK_USER \
+ && [ `id -u $ZK_USER` -eq 1000 ] \
+ && [ `id -g $ZK_USER` -eq 1000 ] \
+ && mkdir -p $ZK_DATA_DIR $ZK_DATA_LOG_DIR $ZK_LOG_DIR /usr/share/zookeeper /tmp/zookeeper /usr/etc/ \
+ && chown -R "$ZK_USER:$ZK_USER" /opt/$ZK_DIST $ZK_DATA_DIR $ZK_LOG_DIR $ZK_DATA_LOG_DIR /tmp/zookeeper \
+ && ln -s /opt/zookeeper/conf/ /usr/etc/zookeeper \
+ && ln -s /opt/zookeeper/bin/* /usr/bin \
+ && ln -s /opt/zookeeper/$ZK_DIST.jar /usr/share/zookeeper/ \
+ && ln -s /opt/zookeeper/lib/* /usr/share/zookeeper