docker - 具有撰写文件的docker swarm无法识别 “links”

标签 docker docker-compose docker-swarm

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/

相关文章:

docker - 链接多个Docker Swarms

docker - 如何永久更新 docker-machine 中的 DOCKER_OPTS

docker - docker 如果没有外壳程序怎么办?

Dockerfile 复制不适用于 Nextcloud 容器

node.js - 如何使用包含数据库创建的 dockerfile 构建 docker 镜像

ember.js - Ember CLI构建被杀死

docker - Netflix/Conductor 打印了太多与 dynomite 相关的日志

error-handling - docker-compose 失败时如何查看错误日志

Docker 注册表(本地): how to limit the number of unique tags per image?

docker - docker-compose部署确保容器已安装在特定服务器上