$ git clone https://github.com/anjia0532/zookeeper-docker.git
$ cd zookeeper-docker
$ docker build --build-arg ZK_VERSION=3.4.10 . -t anjia0532/zookeeper:stable-alpine
$ docker build . -t anjia0532/zookeeper:stable-alpine # default ZK_VERSION is 3.4.11
$ docker run -d --name zk -e ZK_abc_a=1 -e ZK_aBc=1 -e ZK_aB_c=1 anjia0532/zookeeper:3.4.11-alpine && docker container exec zk cat /opt/zk/conf/zoo.cfg
# //output
# //...
# //aB.c=1
# //abc.a=1
# //aBc=1
- ZK_abc_a => abc.a
- ZK_aBc => aBc
- ZK_aB_c => aB.c
$ docker run -d --name zk -e CUSTOM_INIT_SCRIPT="echo 1 > /opt/zk/data/myid" -e ZK_dataDir="/opt/zk/data/" anjia0532/zookeeper:3.4.11-alpine && docker container exec zk cat /opt/zk/conf/zoo.cfg && docker container exec zk cat /opt/zk/data/myid
#// /opt/zk/conf/zoo.cfg output
#// ...
#// dataDir=/opt/zk/data/
#// ...
#// /opt/zk/data/myid output
#// 1
This module is licensed under the BSD license.
Copyright (C) 2017-, by AnJia anjia0532@gmail.com.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
-
Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.