My goal is to execute a benchmark deployed as a docker image. While doing so, I had too many issues, so I decided to first make something extremely trivial work.
So I decided to follow the guide in https://docs.aws.amazon.com/AmazonECS/latest/developerguide/create-task-definition.html and use the "ping" example - it should just ping a domain couple of times, and stop.
The problem is, I always receive this message in the task status:
STOPPED (CannotStartContainerError: Error response from dae)
I tried it with various subnets and security groups, but the result is always the same - the task starts, and after a minute or two fails with the message above.
I even tried it on a fresh new AWS account, using these steps:
- in https://us-east-2.console.aws.amazon.com/ecs/ created new cluster (networking only)
- in task definitions, created a taskdef
- with docker image
alpine:latest, commandping -c 4 google.com
- with docker image
- then I select the cluster, switch to "tasks" tab, and enter the run dialog
- with one of pre-created subnets
After executing:
- the task appears in the cluster's tasks list in PENDING state
- it takes couple of minutes
- eventually (using refresh button), it changes to the mentioned message -
STOPPED (CannotStartContainerError: Error response from dae)
My guess is that the reason is:
- either the task cannot download the image
- or the instance cannot reach outside net
What can I be doing wrong? How to fix?

sh,-cas entry point, or split the command. Waiting for Michal to publish his response so that he can get the credit. - Petr Kozelka["sh","-c"]. But maybe putting this in dockerfile instead would work too, didn't try yet - Petr Kozelka