【发布时间】:2020-05-06 11:56:46
【问题描述】:
我有一个带有网络的 docker swarm 网络名称:traefik-net 类型:覆盖 范围:群
然后我有一个可以工作的 docker compose。
services:
angularDocs:
image: artifactory.company.com/containers/angular-docs:branchName
networks:
- traefik-net
labels:
- "traefik.http.routers.angularDocs.rule=Host(`branchName.angular.swarm.company.com`)"
- "traefik.http.services.angularDocs.loadbalancer.server.port=80"
networks:
traefik-net:
external: true
´´´
But instead of creating a compose file for each container image. I would like to do
docker service create --options artifactory.company.com/containers/angular-docs:branchName
但是当我这样尝试时,它不适用于 traefik
docker service create --name angulardocs --label "traefik.http.routers.angulardocs.rule=Host(`branchName.angular.swarm.company.com`)" --label "traefik.http.services.angulardocs.loadbalancer.server.port=80" --network traefik-net artifactory.company.com/containers/angular-docs:branchName
在 traefik 2.0 中我得到了一条路线
主机(angulardocs-1-egyumq4nfke1lz3ohya38mwsj)
而不是主机(v8.angular.company.com)
与标签在撰写文件中时相比,标签配置错误。
希望有人能解答。
【问题讨论】:
标签: docker deployment traefik swarm