In Docker Swarm each container has both a task ID and a container ID. Given that orchestrators are aware of the containers they run and their Container IDs, why do they assign them a Task ID as well?
Both of these identifiers are unique for the same container so there is a 1 to 1 correlation between them. As can be seen here you can get the Container ID from the Task ID in Swarm via:
docker inspect -f "{{.Status.ContainerStatus.ContainerID}}" <task_id>
And as seen here you can get the opposite via:
docker inspect --format '{{ index .Config.Labels "com.docker.swarm.task.id"}}' <container_id>
I understand that for a container that is connected to an orchestrator there will be more relevant data related to it, however, it would seem to me that that data could be presented by the orchestrator according to the Container ID and there is no need for another identifier. So what is the point that the Task ID serves? What can you accomplish with it that could not be achieved otherwise?
In AWS ECS there is a similar thing however in ECS, you can have more than one container per task definition and those containers will share a task ID, so the correlation is not necessarily 1 to 1.