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模式服务在失败时会重新启动,因此没有理由延迟启动。即使他们失败几次,他们最终也会恢复