首页 > 解决方案 > 提供一种在 docker 中更改或覆盖 zookeeper 配置的方法

问题描述

我将 docker 与 zookeeper 一起使用,

COPY zookeeper-3.4.12.tar.gz /opt
RUN cd /opt && \
        tar -xvf zookeeper-3.4.12.tar.gz
ENV ZK_HOME /opt/zookeeper-3.4.12

zoo.cfg 有很多配置,我想更改这些参数,zoo.cfg

# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of milliseconds of each tick
tickTime=2000
# The number of ticks that the initial
# synchronization phase can take
initLimit=10
# The number of ticks that can pass between
# sending a request and getting an acknowledgement
syncLimit=5

一些 docker 实例更改 syncLimit = 10,一些 docker 实例更改 tickTime=1000 我应该使用 ARG,通过 docker run env 传递这些参数吗?但是如何更改 zoo.cfg 内容?我不想 docker exec -it dockerid,然后更改文件,然后提交。还有其他建议吗?

标签: docker

解决方案


推荐阅读