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.

  • Amazon Container Registry Only with ECS?
  • AWS elastic beanstalk not mounting docker volumes
  • Portainer not able to list the running containers on Rancher OS
  • To what extent can a Docker cluster reduce infrastructure costs? [closed]
  • Running RStudio Shiny as a Docker container on AWS?
  • Deployment methods for docker based micro services architecture on AWS
  • How to change propagation on mounted volumes in docker
  • docker run makes i/o timeout error during installing tensorflow on windows10
  • Remove docker container at the end of each test
  • ImportError: cannot import name <package> in pods while restarting pod fixes
  • How do I pull Docker images from the Tutum private registry with Amazon ECS?
  • npm scoped packages and private registry
  • 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.