I have a problem with docker multicontainer in Elastic Beanstalk AWS, it turns out that I'm starting with this whole docker theme and between information and documentation I managed to create my file "dockerrun.aws.json", which clearly is not well configured, because when executing an "eb deploy" it falls indicating the following error
*Starting environment deployment via CodeCommit
--- Waiting for Application Versions to be pre-processed ---
Finished processing application version app-2a8e3-181016_183848
2018-10-16 21:39:24 INFO Environment update is starting.
2018-10-16 21:39:31 INFO Deploying new version to instance(s).
2018-10-16 21:44:11 ERROR Failed to start ECS task: arn:aws:ecs:us-west-2:147905092845:task/a3ee19dc-25b6-4332-a659-37253e4735cf is STOPPED.
2018-10-16 21:44:28 ERROR ECS task stopped due to: Essential container in task exited. (app:
web: )
2018-10-16 21:45:21 ERROR Failed to start ECS task: arn:aws:ecs:us-west-2:147905092845:task/920b1746-9889-4c77-a5d5-000b826d1420 is STOPPED.
2018-10-16 21:45:29 ERROR Failed to start ECS task after retrying 2 times.
2018-10-16 21:45:34 ERROR [Instance: i-0fb09c3e8864ef050] Command failed on instance. Return code: 1 Output: ask after retrying 2 times.' --severity ERROR
+ exit 1.
Hook /opt/elasticbeanstalk/hooks/appdeploy/enact/03start-task.sh failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
2018-10-16 21:45:35 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2018-10-16 21:45:35 ERROR Unsuccessful command execution on instance id(s) 'i-0fb09c3e8864ef050'. Aborting the operation.
2018-10-16 21:45:35 ERROR Failed to deploy application.
ERROR: ServiceError - Failed to deploy application.*
By entering the log of the ec2 corresponding to elastic beanstalk tells me the following
*[2018-10-16T21:45:29.709Z] INFO [25309] - [Application update app-2a8e3-181016_183848@50/AppDeployStage1/AppDeployEnactHook/03start-task.sh] : Activity execution failed, because: + . /opt/elasticbeanstalk/hooks/common.sh
+ RETRY=0
+ initctl start eb-ecs EB_EVENT_FILE=/tmp/eventsfile20181016-25309-1aovcz6
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...*
So that you can help me, I leave you my dockerrun.aws.json
*{
"AWSEBDockerrunVersion": 2,
"volumes": [
{
"name": "app",
"host": {
"sourcePath": "/var/app/current/public"
}
},
{
"name": "web",
"host": {
"sourcePath": "/var/app/current/proxy/conf.d"
}
}
],
"containerDefinitions": [
{
"name": "app",
"image": "php:7-fpm",
"essential": true,
"memory": 128,
"command": ["php", "configureEnv.php"],
"mountPoints": [
{
"sourceVolume": "app",
"containerPath": "/var/www/html",
"readOnly": true
}
]
},
{
"name": "web",
"image": "nginx:1.10",
"essential": true,
"memory": 128,
"portMappings": [
{
"hostPort": 80,
"containerPort": 80
}
],
"links": [
"app"
],
"mountPoints": [
{
"sourceVolume": "app",
"containerPath": "/var/www/html",
"readOnly": true
},
{
"sourceVolume": "web",
"containerPath": "/etc/nginx/conf.d",
"readOnly": true
}
]
}
]
}*
I tried to execute it without the command thinking that it could be the error, but it throws me the same, so I think it may be something else, but I can not identify the problem.