Search code examples
amazon-web-servicesdockerdocker-composeamazon-ecs

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


I want to upload my docker project to aws ecs. But I got this error.

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

I use docker-compose to upload python , nginx project using ecs-cli.

Here is my ecs-cli command.

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

and here is my 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

Does anyone know it?


Solution

  • I found network couldn't access docker images. I added 'assign_public_ip: ENABLED' to ecs-params.yml , and project was successfully created.