1

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
EOF
$ docker inspect -f'{{json .Config.Labels}}' a19a19847afe
{"asdf":"qwer"}

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
{"asdf":"qwer","qwer":"asdf"}

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.

  • Did you find out more by any chance? – Zdenek F Apr 17 at 9:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.