-
Notifications
You must be signed in to change notification settings - Fork 8
/
Dockerfile
28 lines (24 loc) · 1019 Bytes
/
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
FROM rawmind/alpine-jvm8:1.8.74-1
MAINTAINER Raul Sanchez <[email protected]>
ENV SERVICE_NAME=zk \
SERVICE_HOME=/opt/zk \
SERVICE_VERSION=3.4.6 \
SERVICE_USER=zookeeper \
SERVICE_UID=10002 \
SERVICE_GROUP=zookeeper \
SERVICE_GID=10002 \
PATH=/opt/zk/bin:${PATH}
# Install service software
RUN SERVICE_RELEASE=zookeeper-${SERVICE_VERSION} \
&& curl -sS -k http://apache.rediris.es/zookeeper/${SERVICE_RELEASE}/${SERVICE_RELEASE}.tar.gz | gunzip -c - | tar -xf - -C /opt \
&& mv /opt/zookeeper-* ${SERVICE_HOME} \
&& mkdir -p ${SERVICE_HOME}/logs ${SERVICE_HOME}/data \
&& chmod +x ${SERVICE_HOME}/bin/*.sh \
&& addgroup -g ${SERVICE_GID} ${SERVICE_GROUP} \
&& adduser -g "${SERVICE_NAME} user" -D -h ${SERVICE_HOME} -G ${SERVICE_GROUP} -s /sbin/nologin -u ${SERVICE_UID} ${SERVICE_USER}
ADD root /
RUN chmod +x ${SERVICE_HOME}/bin/*.sh \
&& chown -R ${SERVICE_USER}:${SERVICE_GROUP} ${SERVICE_HOME} /opt/monit
USER $SERVICE_USER
WORKDIR $SERVICE_HOME
EXPOSE 2181 2888 3888