为什么ecs-cli service up很久没有完成

Why ecs-cli service up has not completed for a long time

我想将我的 docker 项目上传到 aws ecs。 但是我得到了这个错误。

INFO[0291] (service myappproject) has started 1 tasks: (task 38184a9c-ff93-4324-b586-424fc025655d).  timestamp="2019-07-02 13:41:45 +0000 UTC"
FATA[0306] Deployment has not completed: Running count has not changed for 5.00 minutes

我使用docker-compose上传python,nginx项目使用ecs-cli.

这是我的 ecs-cli 命令。

ecs-cli \
    compose \
        --verbose \
        --file docker-compose.yml \
        --file docker-compose.production.yml \
        --ecs-params ecs-params.yml \
        --region ap-northeast-1 \
        --cluster myapp \
        --project-name myappproject \
    service up \
        --target-group-arn arn:aws:elasticloadbalancing:ap-northeast-1:294598740507:targetgroup/tsujimoto-app-alb-target-group/41c164d963f49806 \
        --container-name nginx \
        --container-port 80 \
        --force-deployment true \
        --timeout 10

这是我的 ecs-param.yml

ersion: 1
task_definition:
  ecs_network_mode: awsvpc
  task_execution_role: ecs-task-execution
  task_size:
    cpu_limit: 256
    mem_limit: 512
  services:
    myapp:
      essential: true
    nginx:
      essential: true


run_params:
  network_configuration:
    awsvpc_configuration:
      subnets:
        - subnet-096df842a99829e4f
        - subnet-07c7f04d0b61c3346
      security_groups:
        - sg-09d046dd7faac15f4

有人知道吗?

我发现网络无法访问 docker 图片。 我将 'assign_public_ip: ENABLED' 添加到 ecs-params.yml ,项目创建成功。