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.

  • Configuring bitbucket pipelines with Docker to connect to AWS
  • How to use t2.nano ec2 instances in an Amazon ec2 container cluster?
  • JVM memory settings in docker container in AWS beanstalk
  • How do I register logging driver for docker?
  • Elastic beanstalk: Failed to buld docker image
  • how to clean up docker overlay directory?
  • prior storage driver “devicemapper” failed: exit status 1 in docker
  • exec not found using Dockerfile ENTRYPOINT
  • I got an error when I try to delete an image in docker
  • cannot run jfrog executable from inside alpine linux container
  • Docker-compose makes system freeze with chrome open [Ubuntu 16.04]
  • How to config docker registry mirror?
  • 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
    
    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.