AWS Multi-docker deploys the Essential container in a task outgoing

I am having a problem deploying my local docker configuration to AWS:

ERROR: ECS task stopped due to: The main container in the task has finished. (Benj-elasticsearch: Benj-Nginx: benj-php-fpm :)

Error log:

+ RETRY=0
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=1
+ sleep 3
+ '[' 1 -gt 1 ']'
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=2
+ sleep 3
+ '[' 2 -gt 1 ']'
+ error_exit 'Failed to start ECS task after retrying 2 times.' 1
+ error 'Failed to start ECS task after retrying 2 times.'
+ echo 'Failed to start ECS task after retrying 2 times.'
Failed to start ECS task after retrying 2 times.
+ eventHelper.py --msg 'Failed to start ECS task after retrying 2 times.' --severity ERROR
+ exit 1 (ElasticBeanstalk::ExternalInvocationError)
caused by: + . /opt/elasticbeanstalk/hooks/common.sh
+ RETRY=0
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=1
+ sleep 3
+ '[' 1 -gt 1 ']'
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20170711-9737-o42dsc
initctl: Job failed to start
+ '[' -f /etc/elasticbeanstalk/.eb-ecs-start-no-retry ']'
+ warn 'Failed to start ECS task, retrying...'
+ echo 'Failed to start ECS task, retrying...'
Failed to start ECS task, retrying...
+ eventHelper.py --msg 'Failed to start ECS task, retrying...' --severity WARN
+ RETRY=2
+ sleep 3
+ '[' 2 -gt 1 ']'
+ error_exit 'Failed to start ECS task after retrying 2 times.' 1
+ error 'Failed to start ECS task after retrying 2 times.'
+ echo 'Failed to start ECS task after retrying 2 times.'
Failed to start ECS task after retrying 2 times.
+ eventHelper.py --msg 'Failed to start ECS task after retrying 2 times.' --severity ERROR
+ exit 1 (Executor::NonZeroExitStatus)

      

Some notes:

So I have my local docker-compose.yml. I ported this to Dockerrun.aws.js but because I am using my own container (bensji / php-fpm) I had to deploy this container to the cloud.

These are my files: Dockerrun.aws.js

{
"AWSEBDockerrunVersion": 2,
"volumes": [
  {
    "name": "benj",
    "host": {
      "sourcePath": "/var/app/current"
    }
  },
  {
    "name": "fpmconf",
    "host": {
      "sourcePath": "/var/app/current/docker/production/php-fpm"
    }
  },
  {
    "name": "nginxconf",
    "host": {
      "sourcePath": "/var/app/current/docker/production/nginx"
    }
  }
],
"containerDefinitions": [
  {
    "name": "benj-nginx",
    "image": "phpdockerio/nginx:latest",
    "essential": true,
    "memory": 128,
    "environment": [
      {
        "name": "Container",
        "value": "nginx"
      }
    ],
    "portMappings": [
      {
        "hostPort": 80,
        "containerPort": 80
      }
    ],
    "links": [
      "benj-php-fpm"
    ],
    "mountPoints": [
      {
        "sourceVolume": "benj",
        "containerPath": "/var/www/benj",
        "readOnly": true
      },
      {
        "sourceVolume": "nginxconf",
        "containerPath": "/usr/local/nginx/conf",
        "readOnly": true
      }
    ]
  },
  {
    "name": "benj-php-fpm",
    "image": "bensji/php-fpm:latest",
    "environment": [
      {
        "name": "Container",
        "value": "php-fpm"
      }
    ],
    "essential": true,
    "memory": 128,
    "mountPoints": [
      {
        "sourceVolume": "benj",
        "containerPath": "/var/www/benj"
      },
      {
        "sourceVolume": "fpmconf",
        "containerPath": "/usr/local/php/etc",
        "readOnly": true
      }
    ]
  },
  {
    "name": "benj-elasticsearch",
    "image": "docker.elastic.co/elasticsearch/elasticsearch:5.4.0",
    "environment": [
      {
        "name": "Container",
        "value": "elasticsearch"
      }
    ],
    "memory": 128,
    "portMappings": [
      {
        "hostPort": 9200,
        "containerPort": 9200
      }
    ]
  }
]

      

}

Thank.

+3


source to share





All Articles