ECS Showing Error After Running Task Definition “STOPPED (Essential container in task exited)”
i Created one default cluster using “ami-562cf236” in Oregon Region, and i created one task Definition and service but when i’m running this service its throwing error and Stopped : “STOPPED (Essential container in task exited)” i’m pulling image from ECS repository only.
We Are Using Simple Dockerfile, we able to push image form EC2 instance to ECS Repository.
We also make this repository public, now we created Task Definition and Service, and trying to run that, but it is showing same error “STOPPED (Essential container in task exited)”. We are able to pull from ECS Repository but not able to Deploy on On Cluster.
One Solution collect form web for “ECS Showing Error After Running Task Definition “STOPPED (Essential container in task exited)””
Based on the dockerfile i’m actually encountering the expected behavior from the task. Since the only thing happening in the dockerfile is an update, once that update is completed, the container will exit. If i like to keep the container up and running, i need to issue a command to run a program after the update is complete using ‘CMD’.
In the example below, I am running the ‘nc’ command to set up a basic listener server on the container and the container does not exit.
CMD sudo nc -l 80