Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Naming Docker Containers on start ECS

Is there a way to name containers when they start through ECS? Wondering because I'm currently using Datadog to monitor the system usage and the containers are named something long etc like

ecs-datadog-agent-task-1-datadog-agent-c0a1f3e8d9e58dd5e901

would like to set my own name

like image 492
Patrick Avatar asked May 19 '26 05:05

Patrick


1 Answers

No, there is not a way to control the name used for the container in Amazon ECS. ECS picks a random name designed to avoid conflicts (since names must be unique in Docker; you can't have two containers with the same name) and you can see the code here.

However, ECS does give you a few things that might be able to help you. There are automatically-assigned Docker labels for the task ARN, the container name in your task definition, the task definition family, the task definition revision, and the cluster; see here. Additionally, you can assign your own custom Docker labels through the task definition.

like image 125
Samuel Karp Avatar answered May 20 '26 20:05

Samuel Karp



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!