From f506c654ae812303712585c4e0b70d56728cd694 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Sun, 12 Jul 2015 15:12:43 +0900 Subject: [PATCH 1/3] Disables Java's DNS cache by default --- 3.4.6/centos/7/Dockerfile | 3 +++ 3.4.6/ubuntu/14.04/Dockerfile | 3 +++ 2 files changed, 6 insertions(+) diff --git a/3.4.6/centos/7/Dockerfile b/3.4.6/centos/7/Dockerfile index 77281d2..1993e4e 100644 --- a/3.4.6/centos/7/Dockerfile +++ b/3.4.6/centos/7/Dockerfile @@ -4,6 +4,9 @@ RUN yum install -y java-1.7.0-openjdk-headless tar RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6.tar.gz | tar xzf - -C /opt && mv /opt/zookeeper-3.4.6 /opt/zookeeper +RUN echo "networkaddress.cache.ttl=0" >> /usr/lib/jvm/jre/lib/security/java.security && \ + sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /usr/lib/jvm/jre/lib/security/java.security + VOLUME /tmp/zookeeper COPY entrypoint.sh / diff --git a/3.4.6/ubuntu/14.04/Dockerfile b/3.4.6/ubuntu/14.04/Dockerfile index 9576192..58aac12 100644 --- a/3.4.6/ubuntu/14.04/Dockerfile +++ b/3.4.6/ubuntu/14.04/Dockerfile @@ -4,6 +4,9 @@ RUN apt-get update && apt-get install -y curl openjdk-7-jre-headless python RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6.tar.gz | tar xzf - -C /opt && mv /opt/zookeeper-3.4.6 /opt/zookeeper +RUN echo "networkaddress.cache.ttl=0" >> /etc/java-7-openjdk/security/java.security && \ + sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /etc/java-7-openjdk/security/java.security + VOLUME /tmp/zookeeper COPY entrypoint.sh / From e4f9dbd842cf6d1c58ff67dc2ce30c32fbfb59d8 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Sun, 12 Jul 2015 15:13:18 +0900 Subject: [PATCH 2/3] Exposes Zookeeper's default ports --- 3.4.6/centos/7/Dockerfile | 2 ++ 3.4.6/ubuntu/14.04/Dockerfile | 2 ++ 2 files changed, 4 insertions(+) diff --git a/3.4.6/centos/7/Dockerfile b/3.4.6/centos/7/Dockerfile index 1993e4e..12896af 100644 --- a/3.4.6/centos/7/Dockerfile +++ b/3.4.6/centos/7/Dockerfile @@ -7,6 +7,8 @@ RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6. RUN echo "networkaddress.cache.ttl=0" >> /usr/lib/jvm/jre/lib/security/java.security && \ sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /usr/lib/jvm/jre/lib/security/java.security +EXPOSE 2181 2888 3888 + VOLUME /tmp/zookeeper COPY entrypoint.sh / diff --git a/3.4.6/ubuntu/14.04/Dockerfile b/3.4.6/ubuntu/14.04/Dockerfile index 58aac12..79156c0 100644 --- a/3.4.6/ubuntu/14.04/Dockerfile +++ b/3.4.6/ubuntu/14.04/Dockerfile @@ -7,6 +7,8 @@ RUN curl -fL http://mirror.catn.com/pub/apache/zookeeper/stable/zookeeper-3.4.6. RUN echo "networkaddress.cache.ttl=0" >> /etc/java-7-openjdk/security/java.security && \ sed -i 's/networkaddress.cache.negative.ttl=10/networkaddress.cache.negative.ttl=0/g' /etc/java-7-openjdk/security/java.security +EXPOSE 2181 2888 3888 + VOLUME /tmp/zookeeper COPY entrypoint.sh / From 2729c117cd24844a2b6ab64b793cf5a0521612b1 Mon Sep 17 00:00:00 2001 From: Daisuke Baba Date: Thu, 16 Jul 2015 12:47:07 +0900 Subject: [PATCH 3/3] Allows to modify zoo.cfg with environment variables on starting a new container --- 3.4.6/centos/7/entrypoint.sh | 9 +++++---- 3.4.6/ubuntu/14.04/entrypoint.sh | 9 +++++---- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/3.4.6/centos/7/entrypoint.sh b/3.4.6/centos/7/entrypoint.sh index 3ca7b6a..d49a875 100755 --- a/3.4.6/centos/7/entrypoint.sh +++ b/3.4.6/centos/7/entrypoint.sh @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/bash # based on https://github.com/apache/zookeeper/blob/trunk/conf/zoo_sample.cfg cat > /opt/zookeeper/conf/zoo.cfg < /opt/zookeeper/conf/zoo.cfg <