Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/docker/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
docker swarm列出服务的依赖项_Docker_Docker Swarm_Docker Stack - Fatal编程技术网

docker swarm列出服务的依赖项

docker swarm列出服务的依赖项,docker,docker-swarm,docker-stack,Docker,Docker Swarm,Docker Stack,假设我们有以下堆栈文件: version: "3" services: ubuntu: image: ubuntu deploy: replicas: 2 restart_policy: condition: on-failure resources: limits: cpus: "0.1" memory: 50M entrypoint: - tai

假设我们有以下堆栈文件:

version: "3"
services:
  ubuntu:
    image: ubuntu
    deploy:
      replicas: 2
      restart_policy:
        condition: on-failure
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
    entrypoint:
      - tail
      - -f
      - /dev/null
    logging:
      driver: "json-file"
    ports:
      - "80:80"
    networks:
      - webnet
  web:
    image: httpd
    ports:
      - "8080:8080"
    hostname: "apache"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock"
    deploy:
      placement:
        constraints: [node.role == manager]
      resources:
        limits:
          memory: 32M
        reservations:
          memory: 16M
    depends_on:
      - "ubuntu"
    networks:
      - webnet
networks:
  webnet:
当我运行
docker服务inspect mystack\u web
时,生成的输出不会显示对depends\u on条目的任何引用


可以吗?如何打印给定docker服务的依赖项?

docker swarm上没有使用
依赖项:


在swarm模式下使用版本3撰写文件部署堆栈时,
dependens\u on
选项被忽略。-

关于GitHub的另一个很好的解释是:

dependens_on
docker stack deploy
一起使用时是不可操作的。Swarm模式服务在失败时会重新启动,因此没有理由延迟启动。即使他们失败几次,他们最终也会恢复