【问题标题】:Traefik with custom config on ECS在 ECS 上使用自定义配置的 Traefik
【发布时间】:2020-04-04 23:00:40
【问题描述】:

如何在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

【问题讨论】:

    标签: docker amazon-ec2 amazon-ecs traefik


    【解决方案1】:

    您正在寻找在 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

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-07-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-27
      • 2018-03-04
      • 1970-01-01
      相关资源
      最近更新 更多