In my AWS ECS Cluster, there is one service running two tasks. Each Task has 5 containers. Two of them are not essential. Among these two, one of the containers fails some times, but I am not sure how to restart the single container.

docker-compose.yml has an option restart: always. I am assuming some similar functions may restart the container automatically.

Is there any way to restart a single container without touching other containers in ECS Task?

1 Answer 1


I don't think if that is possible - it certainly wasn't a few years ago.

What you may do is have your process in the failing container running in a loop (simple shell script) so that if it fails it restarts the process without restarting the whole container.

Hope that helps :)

  • 1
    What if the container isn't failing per se? What if it just needs to be imperatively restarted so it can pick up on an Extremely Rarely Occuring Change In External Circumstances, a change so rare that the container wasn't (and wasn't expected to be) designed to poll for it continuously? Feb 8, 2021 at 15:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.