I'm running code in docker containers through AWS ECS on the fargate engine. The problem that I'm running into is that my docker image labels are not being applied to the docker container as I would expect.

As a simplified example, I build an image:

docker build --label asdf=qwer - <<EOF
FROM alpine
$ docker inspect -f'{{json .Config.Labels}}' a19a19847afe

I push this up to ECR and create a container using the image in a task, then start it in my service.

If I set a docker label on the container definition like qwer=asdf, this will show up, but my image label of asdf=qwer will not. Running locally works fine though:

$ task=$(docker run -d --label qwer=asdf a19a19847) && docker inspect -f'{{json .Config.Labels}}' $task

Is this feature unsupported by fargate? It almost feels like since it's built into docker that fargate must be doing something to intentionally remove the image labels.

From a wider standpoint though, what I'm looking for is the ability to tell exactly what code is being run inside of my docker container, so I'll consider a simple solution for this problem an answer as well. I'm using a floating production image tag currently and would prefer not to have to change my tag workflow.

EDIT: This question was marked as needing clarification, but as best I can tell this question is clear. If I'm missing detail, please describe what is missing so I can provide it.

  • 1
    Did you find out more by any chance? – Zdenek F Apr 17 '19 at 9:29
  • Could you reply to the comment? – 030 Dec 24 '19 at 13:28
  • I did not find out any more. – user2012688 Mar 18 '20 at 7:33