Open bianjp opened 3 months ago
@31z4 Can you review this PR?
Hi @bianjp.
As mentioned in https://github.com/31z4/zookeeper-docker/pull/145#issuecomment-2220158270 it's already possible to mount a custom zookeeper-env.sh
and therefore adjust Zookeeper configuration via a shell script. So I don't think it's worth it to increase the complexity of the current image entrypoint.
Maybe extend the "Advanced configuration" section of the docs with an example of using zookeeper-env.sh
to customize the config?
Hi @bianjp.
As mentioned in #145 (comment) it's already possible to mount a custom
zookeeper-env.sh
and therefore adjust Zookeeper configuration via a shell script. So I don't think it's worth it to increase the complexity of the current image entrypoint.Maybe extend the "Advanced configuration" section of the docs with an example of using
zookeeper-env.sh
to customize the config?
Yes, zookeeper-env.sh
works, but personally I think it's not elegant, and I double whether it's the intended use case of ZooKeeper maintainer.
Okay if you insist.
See #145
Add support for custom init scripts which can be mounted to
/docker-entrypoint.d/
directory.This will allow more easier, flexible and elegant customization. For example, to deploy a ZooKeeper cluster in Kubernetes, user can mount a custom init script to calculate
ZOO_MY_ID
for each instance.The idea and code is borrowed from official Nginx image.
There are two kinds of init scripts:
*.envsh
: environment script, it will be executed bysource
command, and can be used to export environment variables which will be visible todocker-entrypoint.sh
*.sh
: normal script, normally it should have a shebang to declare how to execute itNote:
.envsh
or.sh
will be ignoredzookeeper
userKubernetes example to mount a init script from ConfigMap: