Today, I encountered a silly problem that caused an ECS service to not launch in a healthy status because the container doesn't be built with a curl command, which is used in the health check command of Dockerfile. After take a while to troubleshoot the problem, and the issue has been fixed by adding RUN apk --no-cache add curl line into the Dockerfile.
However, I found lots of interesting things during troubleshooting the issue on the AWS.
Firstly, we can attach a session to the container that is running in the Fargate [1], which requires Session Manager Plugin on the local machine [2].
And then, you can run the following command to check if your local environment is ready to attach to the ECS task container [3].
Today, I encountered a silly problem that caused an ECS service to not launch in a healthy status because the container doesn't be built with a
curl
command, which is used in the health check command ofDockerfile
. After take a while to troubleshoot the problem, and the issue has been fixed by addingRUN apk --no-cache add curl
line into the Dockerfile.However, I found lots of interesting things during troubleshooting the issue on the AWS.
Firstly, we can attach a session to the container that is running in the Fargate [1], which requires
Session Manager Plugin
on the local machine [2].And then, you can run the following command to check if your local environment is ready to attach to the ECS task container [3].
Until now, you would need to run the following command to enable "execute-command" in the cluster, and the command to attach to the running container.
This is an excellent experience to learn more tools for helping me troubleshoot the ECS service.
[1] https://aws.amazon.com/blogs/containers/new-using-amazon-ecs-exec-access-your-containers-fargate-ec2/ [2] https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html#install-plugin-macos [3] https://github.com/aws-containers/amazon-ecs-exec-checker