Docker-组成运行容器

Docker-compose running container

我正在尝试启动一个 zookeeper 实例和一个使用 docker-compose 连接到 zookeeper 实例的进程(docker-compose.yml 文件中的内容)。一旦 docker 获取两个实体的存储库并启动 zookeeper 实例,它就无法将进程连接到 zookeeper 实例并优雅地停止整个设置并抛出此错误 -

{
abc_1 |    "warnings" : [],
abc_1|    "diskperms" : {},
abc_1 |    "diskspace" : {},
abc_1 |    "data" : [],
abc_1 |    "log" : [
abc_1 |       "[ERROR] [28] Local-disk package '/packages/xyz.tar.gz' does not exist on disk."
abc_1 |    ],
abc_1 |    "http_info" : {},
abc_1 |    "result" : {
abc_1 |       "msg" : "Local-disk package '/packages/xyz.tar.gz' does not exist on disk.",
abc_1 |       "status" : 1
abc_1 |    },
abc_1 |    "state" : {}
abc_1 | }
dockerzookeeper1_abc_1 exited with code 1
Gracefully stopping... (press Ctrl+C again to force)
Stopping dockerzookeeper1_zookeeper_1...

有人可以告诉我如何使用 docker-compose 解决这个问题吗?

Docker 文件 -

docker 文件如下所示 -

FROM debian:jessie
RUN apt-get update && apt-get install -y openjdk-7-jre-headless wget
RUN wget -q -O - http://apache.mirrors.pair.com/zookeeper/zookeeper-3.4.6/zookeeper-3.4.6.tar.gz | tar -xzf - -C /opt \
    && mv /opt/zookeeper-3.4.6 /opt/zookeeper \
    && cp /opt/zookeeper/conf/zoo_sample.cfg /opt/zookeeper/conf/zoo.cfg \
    && mkdir -p /tmp/zookeeper
ENV JAVA_HOME /usr/lib/jvm/java-7-openjdk-amd64
EXPOSE 2181 2888 3888
WORKDIR /opt/zookeeper

VOLUME ["/opt/zookeeper/conf", "/tmp/zookeeper"]

ENTRYPOINT ["/opt/zookeeper/bin/zkServer.sh"]
CMD ["start-foreground"

我通过 boot2docker 重启解决了这个问题。问题出在 DNS 上,我在两个地方之间的连接之间切换,幸运的是重新启动 boot2docker 解决了这个问题。