在 ECS 上使用自定义配置的 Traefik

Traefik with custom config on ECS

如何在ECS上上传内嵌配置文件的traefik镜像?

docker run -d -p 8080: 8080 -p 80:80 \
-v $PWD/traefik.toml:/etc/traefik/traefik.toml \
-v /var/run/docker.sock:/var/run/docker.sock \
traefik: v1.7

如何在 ECS 上复制 -v $PWD /traefik.toml:/etc/traefik/traefik.toml

您正在寻找绑定挂载,ECS 任务定义中的 ContainerDefinition 中的 'mountPoints' 等同于 Docker 绑定挂载:

"volumes": [
    {
      "name": "traefikroot",
      "host": {
        "sourcePath": "/traefikroot"
      }
    }
  ]

  "mountPoints": [
    {
      "sourceVolume": "traefikroot",
      "containerPath": "/etc/traefik"
    }
  ]

“/traefikroot”中的任何文件都将提交给“/etc/traefik”中的容器。

请在此处查看详细示例: - https://docs.aws.amazon.com/AmazonECS/latest/developerguide/bind-mounts.html#bind-mount-examples