2

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?

Ariful Haque
  • 161
  • 1
  • 1
  • 6

1 Answers1

0

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 :)

MLu
  • 23,798
  • 5
  • 54
  • 81
  • 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? – Szczepan Hołyszewski Feb 08 '21 at 15:11