HUB
Sign inSign up
zookeeper logo

bbvalabs/zookeeper

By bbvalabs

•Updated over 9 years ago

Zookeeper docker image

Image
1

4.0K

bbvalabs/zookeeper repository overview

CircleCI Docker Pulls Docker Stars Docker Layering

⁠Zookeeper Docker Image

The aim of this project is create/use zookeeper docker images.

⁠Build an image

export ZOO_HOME="/opt/zookeeper"
export ZOO_VERSION="3.4.10"
$docker build --build-arg ZOO_VERSION=$ZOO_VERSION --build-arg ZOO_HOME=$ZOO_HOME \
-t engapa/zookeeper:${ZOO_VERSION} .

The zk_download.sh script is used to download the suitable release. The built docker image will contain a zookeeper distribution (${ZOO_VERSION}) under the directory $ZOO_HOME.

Besides, we've added two scripts :

  • zk_env.sh : Export needed env variable for setup script.
  • zk_setup.sh : Configure zookeeper dynamically , based on utils-docker project⁠

⁠Run a container

By default the entrypoint of container is zk_env.sh. This image hasn't any CMD entry, users are the responsible for launching any command when they are going to run the container.

Let's run a zookeeper container :

docker run -it -e "SETUP_DEBUG=true" engapa/zookeeper:${ZOO_VERSION}

NOTE: We've pass a SETUP_DEBUG environment variable to view the setup process of config files.

⁠Setting up

Users can pass parameters to config files just adding environment variables with specific name patterns.

This table collects the patterns of variable names which will are written in each file:

PREFIXFILE (${ZOO_HOME}/config)Example
ZK_zoo.cfgZK_maxClientCnxns=0 --> maxClientCnxns=0
LOG4J_log4j.propertiesLOG4J_log4j_rootLogger=INFO, stdout--> log4j.rootLogger=INFO, stdout
JAVA_ZK_java.envJAVA_ZK_JVMFLAG="-Xmx1G -Xms1G" --> JVMFLAG="-Xmx1G -Xms1G"

So we can configure our zookeeper server in docker run time :

$docker run -it -d -e "LOG4J_log4j_rootLogger=DEBUG, stdout"

Also you may use --env-file option to load these variables from a file.

And , of course, you could provide your own properties files directly by option -v and don't use zk_setup script.

⁠k8s

In k8s directory⁠ directory there are some resources for Kubernetes

Thanks to kubernetes team for the contrib⁠ .

⁠Openshift

In openshift⁠ directory we have a couple of templates to install within Openshift

⁠Author

Enrique Garcia [email protected]⁠

Tag summary
Recent tags
Content type
Image
Digest
Size
132.7 MB
Last updated
over 9 years ago
docker pull bbvalabs/zookeeper:latest