@@ -5,18 +5,21 @@ ZK_DATA_LOG_DIR=/var/lib/zookeeper/log \
5
5
ZK_LOG_DIR=/var/log/zookeeper \
6
6
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
7
7
8
+ ARG ZK_VERSION=3.5.6
9
+ ARG ZK_DIST=zookeeper-$ZK_VERSION
10
+
8
11
COPY zookeeper-authors-keys .
9
12
10
- ARG ZK_DIST=zookeeper-3.4.10
11
13
RUN set -x \
12
14
&& apt-get update \
13
15
&& apt-get install -y openjdk-8-jre-headless wget netcat-openbsd \
14
- && wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz" \
15
- && wget -q "http://www.apache.org/dist/zookeeper/$ZK_DIST/$ZK_DIST.tar.gz.asc" \
16
+ && wget -O "$ZK_DIST.tar.gz" - q "http://www.apache.org/dist/zookeeper/$ZK_DIST/apache- $ZK_DIST-bin .tar.gz" \
17
+ && wget -O "$ZK_DIST.tar.gz.asc" - q "http://www.apache.org/dist/zookeeper/$ZK_DIST/apache- $ZK_DIST-bin .tar.gz.asc" \
16
18
&& export GNUPGHOME="$(mktemp -d)" \
17
19
&& gpg --import zookeeper-authors-keys \
18
- && gpg --batch --verify "apache-$ZK_DIST.tar.gz.asc" "apache-$ZK_DIST.tar.gz" \
19
- && tar -xzf "$ZK_DIST.tar.gz" -C /opt \
20
+ && gpg --batch --verify "$ZK_DIST.tar.gz.asc" "$ZK_DIST.tar.gz" \
21
+ && mkdir opt/$ZK_DIST \
22
+ && tar -xzf "$ZK_DIST.tar.gz" -C /opt/$ZK_DIST --strip-components 1 \
20
23
&& rm -r "$GNUPGHOME" "$ZK_DIST.tar.gz" "$ZK_DIST.tar.gz.asc" \
21
24
&& ln -s /opt/$ZK_DIST /opt/zookeeper \
22
25
&& rm -rf /opt/zookeeper/CHANGES.txt \
@@ -43,7 +46,7 @@ RUN set -x \
43
46
COPY scripts /opt/zookeeper/bin/
44
47
45
48
# Create a user for the zookeeper process and configure file system ownership
46
- # for nessecary directories and symlink the distribution as a user executable
49
+ # for necessary directories and symlink the distribution as a user executable
47
50
RUN set -x \
48
51
&& useradd $ZK_USER \
49
52
&& [ `id -u $ZK_USER` -eq 1000 ] \
@@ -52,5 +55,4 @@ RUN set -x \
52
55
&& chown -R "$ZK_USER:$ZK_USER" /opt/$ZK_DIST $ZK_DATA_DIR $ZK_LOG_DIR $ZK_DATA_LOG_DIR /tmp/zookeeper \
53
56
&& ln -s /opt/zookeeper/conf/ /usr/etc/zookeeper \
54
57
&& ln -s /opt/zookeeper/bin/* /usr/bin \
55
- && ln -s /opt/zookeeper/$ZK_DIST.jar /usr/share/zookeeper/ \
56
58
&& ln -s /opt/zookeeper/lib/* /usr/share/zookeeper
0 commit comments