forked from wurstmeister/zookeeper-docker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
71 lines (56 loc) · 2.67 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
65
66
67
68
69
70
71
# FROM wurstmeister/base
FROM arm32v7/openjdk:8u212-jre-slim
# do the wurstmeister/base stuff
#FROM ubuntu:trusty
#MAINTAINER Wurstmeister
#RUN apt-get update; apt-get install -y unzip openjdk-7-jre-headless wget supervisor docker.io openssh-server
#ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64/
#RUN echo 'root:wurstmeister' | chpasswd
#RUN mkdir /var/run/sshd
#RUN sed -i 's/PermitRootLogin without-password/PermitRootLogin yes/' /etc/ssh/sshd_config
#EXPOSE 22
# end wurstmeister/base
ARG zookeeper_version=3.4.14
ARG vcs_ref=unspecified
ARG build_date=unspecified
LABEL org.label-schema.name="zookeeper" \
org.label-schema.description="Apache zookeeper" \
org.label-schema.build-date="${build_date}" \
org.label-schema.vcs-url="https://github.com/bqstony/zookeeper-docker" \
org.label-schema.vcs-ref="${vcs_ref}" \
org.label-schema.version="${zookeeper_version}" \
org.label-schema.schema-version="1.0" \
maintainer="Wurstmeister, bqstony"
ENV ZOOKEEPER_VERSION=$zookeeper_version
# Udpate requireded package
# ToDo: Oneliner possible?
RUN apt-get update
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends apt-utils
RUN apt-get install -y wget \
&& apt-get install -y gpg
#Download Zookeeper
RUN wget -q http://mirror.vorboss.net/apache/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz && \
wget -q https://www.apache.org/dist/zookeeper/KEYS && \
wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc && \
wget -q https://www.apache.org/dist/zookeeper/zookeeper-${ZOOKEEPER_VERSION}/zookeeper-${ZOOKEEPER_VERSION}.tar.gz.sha256
#Verify download
RUN sha256sum -c zookeeper-${ZOOKEEPER_VERSION}.tar.gz.sha256 && \
gpg --import KEYS && \
gpg --verify zookeeper-${ZOOKEEPER_VERSION}.tar.gz.asc
#Install
RUN tar -xzf zookeeper-${ZOOKEEPER_VERSION}.tar.gz -C /opt
#Configure
RUN mv /opt/zookeeper-${ZOOKEEPER_VERSION}/conf/zoo_sample.cfg /opt/zookeeper-${ZOOKEEPER_VERSION}/conf/zoo.cfg
# Tone down the JVM heap etc. for the RASPI we only have 1G
ENV ZK_SERVER_HEAP 384
ENV ZK_CLIENT_HEAP 128
# should be in base image and not nessessary anymore
#ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
ENV ZK_HOME /opt/zookeeper-${ZOOKEEPER_VERSION}
RUN sed -i "s|/tmp/zookeeper|$ZK_HOME/data|g" $ZK_HOME/conf/zoo.cfg; mkdir $ZK_HOME/data
ADD start-zk.sh /usr/bin/start-zk.sh
EXPOSE 2181 2888 3888
WORKDIR /opt/zookeeper-${ZOOKEEPER_VERSION}
VOLUME ["/opt/zookeeper-${ZOOKEEPER_VERSION}/conf", "/opt/zookeeper-${ZOOKEEPER_VERSION}/data"]
#from base image, does not work.. ->CMD /usr/sbin/sshd && bash /usr/bin/start-zk.sh
CMD bash /usr/bin/start-zk.sh