The Amazon ECS container agent only monitors and reports on the health checks that are specified in the task definition. Amazon ECS doesn't monitor Docker health checks that are embedded in a container image but aren't specified in the container definition.
2条答案
按热度按时间2hh7jdfx1#
您可以通过taskDefinition中
containerDefinitions
中的容器配置容器healthcheck
https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_healthcheck
vd8tlhqk2#
我今天对此进行了调查,似乎ECS不支持使用
Dockerfile
中定义的HEALTHCHECK
。https://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_healthcheck 明确表示
因此,您需要将
healthcheck
选项添加到任务定义中,以便ECS使用它。