提供一种在Docker中更改或覆盖Zookeeper配置的方法

时间:2018-07-13 13:17:11

标签: docker

我将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并更改文件,然后提交。还有其他建议吗?

0 个答案:

没有答案