Azure-Container-Service中的安装卷不适用于traefik.toml和/var/run/docker.sock

时间:2017-11-23 21:50:15

标签: docker mount docker-volume traefik azure-container-service

构建从VSTS到Azure容器服务的CI / CD管道我遇到了挂载traefik.toml和docker.sock文件的问题。

部署使用SSH隧道创建文件夹/ Deploy /并复制docker-compose.yml和traefik.toml。文件在那里,容器被旋转。但是没有由traefik处理,因为它没有看到'容器。

traefik教程显示我们可以在 docker-compose.yml 中安装类似的东西:

version: '2' 

services:
  proxy:
    build: 
      context: .
      dockerfile: /Traefik/dockerfile
    restart: always
    command: --web --docker --docker.domain=docker.localhost --logLevel=DEBUG
    networks:
      - internal
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - /dev/null:/traefik.toml

这在我的Windows 10机器上运行完全正常,运行docker 17.09.0-ce 但是当部署到Azure-Container-Service时,我收到以下错误:

ERROR: Named volume "\var\run\docker.sock:/var/run/docker.sock:rw" is used in service "proxy" but no declaration was found in the volumes section.

https://github.com/docker/compose/issues/3073选择额外的点(。)来表示它是到主机卷的映射。尝试过它,没有错误,但它实际上没有挂载。

 "Mounts": [
            {
                "Type": "bind",
                "Source": "/home/dutchitworks/deploy/.\\var\\run\\docker.sock",
                "Destination": "/var/run/docker.sock",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            },
            {
                "Type": "bind",
                "Source": "/home/dutchitworks/deploy/.\\dev\\null",
                "Destination": "/traefik.toml",
                "Mode": "rw",
                "RW": true,
                "Propagation": "rprivate"
            }
        ],

它添加了/ home / dutchitworks / deploy /。来自某个地方...

任何有关如何正确映射traefik.toml的想法都会受到欢迎......

0 个答案:

没有答案