Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for autopurge configuration for Zookeeper #4716

Merged
merged 1 commit into from
Aug 13, 2018

Conversation

31z4
Copy link
Contributor

@31z4 31z4 commented Aug 12, 2018

@yosifkit
Copy link
Member

Diff:
diff --git a/zookeeper_3.5/Dockerfile b/zookeeper_3.5/Dockerfile
index 059c1dd..188391f 100644
--- a/zookeeper_3.5/Dockerfile
+++ b/zookeeper_3.5/Dockerfile
@@ -13,6 +13,8 @@ ENV ZOO_USER=zookeeper \
     ZOO_TICK_TIME=2000 \
     ZOO_INIT_LIMIT=5 \
     ZOO_SYNC_LIMIT=2 \
+    ZOO_AUTOPURGE_PURGEINTERVAL=0 \
+    ZOO_AUTOPURGE_SNAPRETAINCOUNT=3 \
     ZOO_MAX_CLIENT_CNXNS=60 \
     ZOO_STANDALONE_ENABLED=false
 
@@ -38,8 +40,7 @@ RUN set -ex; \
     gpg --keyserver pgp.mit.edu --recv-keys "$GPG_KEY" || \
     gpg --keyserver keyserver.pgp.com --recv-keys "$GPG_KEY"; \
     gpg --batch --verify "$DISTRO_NAME.tar.gz.asc" "$DISTRO_NAME.tar.gz"; \
-    # TODO: the distribution given by apache is not gzipped correctly - unzip correctly when fixed
-    tar -xf "$DISTRO_NAME.tar.gz"; \
+    tar -zxf "$DISTRO_NAME.tar.gz"; \
     mv "$DISTRO_NAME/conf/"* "$ZOO_CONF_DIR"; \
     rm -rf "$GNUPGHOME" "$DISTRO_NAME.tar.gz" "$DISTRO_NAME.tar.gz.asc"; \
     apk del .build-deps; \
diff --git a/zookeeper_3.5/docker-entrypoint.sh b/zookeeper_3.5/docker-entrypoint.sh
index 43eae91..aa6a9c9 100755
--- a/zookeeper_3.5/docker-entrypoint.sh
+++ b/zookeeper_3.5/docker-entrypoint.sh
@@ -19,6 +19,8 @@ if [[ ! -f "$ZOO_CONF_DIR/zoo.cfg" ]]; then
     echo "initLimit=$ZOO_INIT_LIMIT" >> "$CONFIG"
     echo "syncLimit=$ZOO_SYNC_LIMIT" >> "$CONFIG"
 
+    echo "autopurge.snapRetainCount=$ZOO_AUTOPURGE_SNAPRETAINCOUNT" >> "$CONFIG"
+    echo "autopurge.purgeInterval=$ZOO_AUTOPURGE_PURGEINTERVAL" >> "$CONFIG"
     echo "maxClientCnxns=$ZOO_MAX_CLIENT_CNXNS" >> "$CONFIG"
     echo "standaloneEnabled=$ZOO_STANDALONE_ENABLED" >> "$CONFIG"
 
diff --git a/zookeeper_latest/Dockerfile b/zookeeper_latest/Dockerfile
index 0887e69..b3e185a 100644
--- a/zookeeper_latest/Dockerfile
+++ b/zookeeper_latest/Dockerfile
@@ -13,6 +13,8 @@ ENV ZOO_USER=zookeeper \
     ZOO_TICK_TIME=2000 \
     ZOO_INIT_LIMIT=5 \
     ZOO_SYNC_LIMIT=2 \
+    ZOO_AUTOPURGE_PURGEINTERVAL=0 \
+    ZOO_AUTOPURGE_SNAPRETAINCOUNT=3 \
     ZOO_MAX_CLIENT_CNXNS=60
 
 # Add a user and make dirs
diff --git a/zookeeper_latest/docker-entrypoint.sh b/zookeeper_latest/docker-entrypoint.sh
index 19b0c5e..9f36a0e 100755
--- a/zookeeper_latest/docker-entrypoint.sh
+++ b/zookeeper_latest/docker-entrypoint.sh
@@ -20,6 +20,8 @@ if [[ ! -f "$ZOO_CONF_DIR/zoo.cfg" ]]; then
     echo "initLimit=$ZOO_INIT_LIMIT" >> "$CONFIG"
     echo "syncLimit=$ZOO_SYNC_LIMIT" >> "$CONFIG"
 
+    echo "autopurge.snapRetainCount=$ZOO_AUTOPURGE_SNAPRETAINCOUNT" >> "$CONFIG"
+    echo "autopurge.purgeInterval=$ZOO_AUTOPURGE_PURGEINTERVAL" >> "$CONFIG"
     echo "maxClientCnxns=$ZOO_MAX_CLIENT_CNXNS" >> "$CONFIG"
 
     for server in $ZOO_SERVERS; do

@yosifkit
Copy link
Member

Build test of #4716; 631e6f3; amd64 (zookeeper):

$ bashbrew build zookeeper:3.4.13
Building bashbrew/cache:4db48ebbf1963e1d78ff41c88eac3a09df207471b026fae67a595c2013126d61 (zookeeper:3.4.13)
Tagging zookeeper:3.4.13
Tagging zookeeper:3.4
Tagging zookeeper:latest

$ test/run.sh zookeeper:3.4.13
testing zookeeper:3.4.13
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'zookeeper-basics' [5/5]...passed


$ bashbrew build zookeeper:3.5.4-beta
Building bashbrew/cache:f19712f00697634bc7997a9abcf3b0d0589de4aad00cce720dc946bc8cb17ee7 (zookeeper:3.5.4-beta)
Tagging zookeeper:3.5.4-beta
Tagging zookeeper:3.5

$ test/run.sh zookeeper:3.5.4-beta
testing zookeeper:3.5.4-beta
	'utc' [1/5]...passed
	'cve-2014--shellshock' [2/5]...passed
	'no-hard-coded-passwords' [3/5]...passed
	'override-cmd' [4/5]...passed
	'zookeeper-basics' [5/5]....passed

@yosifkit yosifkit merged commit 84de637 into docker-library:master Aug 13, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants