0

我正在尝试使用 Ansible Container 在多个 Docker 容器之间共享一个卷,但出现以下错误:

docker.errors.NotFound:404 客户端错误:未找到(“没有这样的容器:web_data”)

我的 container.yml 看起来像:

version: "2"
services:
  web_data:
    from: centos:7
    roles:
      - data
    volumes:
      - /var/www/deployment
    command: [tail, -f, /dev/null]
  nginx:
    from: centos:7
    ports:
      - 8888:80
    roles:
      - nginx
    volumes_from:
      - web_data
    command: [supervisord]

当第二个容器开始构建时会发生错误。我在网上看了一下,显然使用--debug开关应该可以解决这个问题,但不是。

Ansible 版本是:

ansible (2.5.0)
ansible-container (0.9.2)

Docker 版本是:

docker (2.5.1)
docker-compose (1.12.0)
docker-py (1.10.6)
docker-pycreds (0.2.1)

谢谢,

4

1 回答 1

0

好的,事实证明volumes_fromansible-container build 忽略了它。

https://docs.ansible.com/ansible-container/container_yml/reference.html#volumes-from

于 2017-10-11T05:11:33.033 回答