docker-compose.yml
version: '3.3'
services:
hello:
image: dockercloud/hello-world
service_auth:
image: beevelop/nginx-basic-auth
ports:
- 8080:80
links:
- hello:web
environment:
HTPASSWD: 'foo:$apr1$odHl5EJN$KbxMfo86Qdve2FH4owePn.'
docker -版本
Docker version 17.09.0-ce, build afdb6d4
docker stack deploy -c docker-compose.yml auth
Ignoring unsupported options: links
为什么不支持链接?
最佳答案
official documentation确实列出了compose和stack不支持的内容,其中包括 links 。
Links are not required to enable services to communicate - by default, any service can reach any other service at that service’s name. (See also, the Links topic in Networking in Compose.)
因此,该选项是带有(版本3)撰写文件的ignored when deploying a stack in swarm mode。
$ docker stack deploy --compose-file docker-compose.yml vossibility
Ignoring unsupported options: links
关于docker - 具有撰写文件的docker swarm无法识别 “links”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47627000/