-
Notifications
You must be signed in to change notification settings - Fork 88
/
Dockerfile
46 lines (36 loc) · 1.83 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
FROM debian:7.8
MAINTAINER Mike Babineau [email protected]
ENV \
ZK_RELEASE="http://www.apache.org/dist/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz" \
EXHIBITOR_POM="https://raw.githubusercontent.com/Netflix/exhibitor/d911a16d704bbe790d84bbacc655ef050c1f5806/exhibitor-standalone/src/main/resources/buildscripts/standalone/maven/pom.xml" \
# Append "+" to ensure the package doesn't get purged
BUILD_DEPS="curl maven openjdk-7-jdk+" \
DEBIAN_FRONTEND="noninteractive"
# Use one step so we can remove intermediate dependencies and minimize size
RUN \
# Install dependencies
apt-get update \
&& apt-get install -y --allow-unauthenticated --no-install-recommends $BUILD_DEPS \
# Default DNS cache TTL is -1. DNS records, like, change, man.
&& grep '^networkaddress.cache.ttl=' /etc/java-7-openjdk/security/java.security || echo 'networkaddress.cache.ttl=60' >> /etc/java-7-openjdk/security/java.security \
# Install ZK
&& curl -Lo /tmp/zookeeper.tgz $ZK_RELEASE \
&& mkdir -p /opt/zookeeper/transactions /opt/zookeeper/snapshots \
&& tar -xzf /tmp/zookeeper.tgz -C /opt/zookeeper --strip=1 \
&& rm /tmp/zookeeper.tgz \
# Install Exhibitor
&& mkdir -p /opt/exhibitor \
&& curl -Lo /opt/exhibitor/pom.xml $EXHIBITOR_POM \
&& mvn -f /opt/exhibitor/pom.xml package \
&& ln -s /opt/exhibitor/target/exhibitor*jar /opt/exhibitor/exhibitor.jar \
# Remove build-time dependencies
&& apt-get purge -y --auto-remove $BUILD_DEPS \
&& rm -rf /var/lib/apt/lists/*
# Add the wrapper script to setup configs and exec exhibitor
ADD include/wrapper.sh /opt/exhibitor/wrapper.sh
# Add the optional web.xml for authentication
ADD include/web.xml /opt/exhibitor/web.xml
USER root
WORKDIR /opt/exhibitor
EXPOSE 2181 2888 3888 8181
ENTRYPOINT ["bash", "-ex", "/opt/exhibitor/wrapper.sh"]