The aim of this project is create/use zookeeper docker images.
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 :
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.
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:
| PREFIX | FILE (${ZOO_HOME}/config) | Example |
|---|---|---|
| ZK_ | zoo.cfg | ZK_maxClientCnxns=0 --> maxClientCnxns=0 |
| LOG4J_ | log4j.properties | LOG4J_log4j_rootLogger=INFO, stdout--> log4j.rootLogger=INFO, stdout |
| JAVA_ZK_ | java.env | JAVA_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.
In k8s directory directory there are some resources for Kubernetes
Thanks to kubernetes team for the contrib .
In openshift directory we have a couple of templates to install within Openshift
Enrique Garcia [email protected]
docker pull bbvalabs/zookeeper:latest