elasticbeanstalk 多容器不会从中选择最新的图像

elasticbeanstalk multicontainer will not pick the latest Image from

我有一个 python 多容器服务器设置,其中 Dockerrun.aws.json 文件从 ECR 中获取图像:

{
"AWSEBDockerrunVersion": 2,
"volumes": [
    {
        "host": {
            "sourcePath": "API"
        },
        "name": "_Api"
    }
],
"containerDefinitions": [
    {
        "essential": true,
        "Update": true,
        "memory": 128,
        "name": "my_api",
        "image": "xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-api:test1",
        "mountPoints": [
            {
                "containerPath": "/code",
                "sourceVolume": "_Api"
            }
        ]
    },
    {
        "essential": true,
        "memory": 128,
        "name": "nginx",
        "image": "xxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/dashboard-nginx:test1",
        "portMappings": [
            {
                "containerPort": 80,
                "hostPort": 80
            }
        ],
         "links": [
             "my_api"
         ]
    },
    {
        "essential": true,
        "memory": 128,
        "name": "redis",
        "image": "redis:latest",
        "portMappings": [
            {
                "containerPort": 6379,
                "hostPort": 6379
            }
        ]
    }
]

我对容器做了一些修改,希望使用 eb local run 命令在本地进行测试 但无论我做什么都是使用原始旧图像

我有一个并行的 docker-compose.yml 我在 EB 之前使用过 - 它按预期工作:

       version: '3'
services:
   my_api:
       image: xxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-api:test1
       build: ./API
       expose:
           - "5555"
       volumes:
           - ./API:/code
       depends_on:
           - redis
   redis:
       image: redis:latest
       networks:
         - service
       ports:
           - "6379:6379"
       expose:
           - "6379"
   nginx:
       image: xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-nginx:test1
       build:
           context: ./API
           dockerfile: Dockerfile-nginx
       ports:
           - 80:80
       depends_on:
           - my_api

我尝试使用 docker-compose 构建和推送。以及 docker 和新标签等等 但我仍然得到相同的行为

.elasticbeanstalk/docker-compose.yml 文件似乎得到更新,但即使 运行ning docker-compose up --build 仍然使用旧图像

我尝试 运行ning docker system p运行e -a 让 eb 拉取新的标记容器 - 但不知何故,我又得到了旧图像

即使部署到 AWS 也一样

当我 运行 docker ps -a 时,我可以看到使用的容器只是名称不同,但使用不同的图像 ID:

89b258852e84        xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-nginx:test1   "nginx -g 'daemon of…"   9 minutes ago       Exited (0) 5 minutes ago                       dashboard-nginx
23196d6e8016        xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-api:test1     "uwsgi --ini app.ini"    9 minutes ago       Exited (0) 5 minutes ago                       dashboard-api
95b4473bc38f        redis:latest                                                         "docker-entrypoint.s…"   9 minutes ago       Exited (0) 5 minutes ago                       live_dashboard_redis_1
32be5539e905        xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-nginx:test1   "nginx -g 'daemon of…"   10 minutes ago      Exited (0) 6 minutes ago                       elasticbeanstalk_nginx_1
51d89fcdfd94        redis:latest                                                         "docker-entrypoint.s…"   10 minutes ago      Exited (0) 6 minutes ago                       elasticbeanstalk_redis_1
e10715455525        xxxxxxxxx.dkr.ecr.eu-west-1.amazonaws.com/my-api:test1     "uwsgi --ini app.ini"    10 minutes ago      Exited (0) 6 minutes ago                       elasticbeanstalk_myapi_1

我错过了什么或没有完全理解? 有什么方法可以使 eb 本地重建并在本地使用最新图像? 为什么 EB 在部署时不拉取最新版本的图像? 任何帮助或建议将不胜感激

编辑1

我收集到的更多信息 当我检查 docker-compose 图像和 eb 图像时,我可以看到它们有一个不同的 Mount 部分,可以解释代码差异:

docker-撰写

"Mounts": [
   {
       "Type": "bind",
       "Source": "/host_mnt/c/Workspaces/PRJ/DevOps/Tools/proj/API",

       "Destination": "/code",

       "Mode": "rw",
       "RW": true,
       "Propagation": "rprivate"
   }
]

eb:


       "Mounts": [
           {
               "Type": "volume",
               "Name": "API",
               "Source": "/var/lib/docker/volumes/API/_data",
               "Destination": "/code",
               "Driver": "local",
               "Mode": "rw",
               "RW": true,
               "Propagation": ""
           }
       ]

奇怪,因为我正在处理 windows

在 phone 上使用 AWS Support 几天后 最后我们得到了答案 因此,如果将来有人遇到这种情况,您需要检查您的安装设置

选择音量 /var/app/current/API

"volumes": [
    {
        "host": {
            "sourcePath": "/var/app/current/API"
        },
        "name": "_Api"
    }
],