aws / aws/containers-roadmap

[FARGATE] [request]: Image labels are not visible on the metadata endpoint

Open
#757 4 comments 59 reactions 0 assignees View on GitHub
Fargate Proposed
Dominant language
Shell
Stars
5.4k
Forks
334
PR merge metrics
No merged PRs in 30d

Description

### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

**Tell us about your request**
ECS Task definition supports `dockerLabel` map, that adds labels to the container. These labels are visible in the container, if queried from the metadata server (`curl -s 169.254.170.2/v2/metadata | jq .Labels`).

`Dockerfile` supports `LABEL` statements that add labels to the image, when running locally with `docker run`, these labels are assigned to the container (and visible with `docker inspect $container_id`). When running in fargate, these labels are not visible on the metadata server (when queried by `curl -s 169.254.170.2/v2/metadata | jq .Labels`)

**Which service(s) is this request for?**
Fargate. ECS might also be affected by this

**Tell us about the problem you're trying to solve. What are you trying to do, and why is it hard?**
Trying to add additional metadata (git-sha + build version) to metrics collected by 3rd party agent. For example Datadog supports `DD_DOCKER_LABELS_AS_TAGS` option, which allows tagging everything coming out from the agent.

**Are you currently working around this issue?**
Work around would be updating task definition

**Additional context**
I am not the only person to run into this: [this stack exchange question](https://devops.stackexchange.com/questions/6825/docker-image-labels-in-fargate-are-not-applied-to-containers).

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the metadata request against 169.254.170.2/v2/metadata and compare Dockerfile LABEL values with task-definition dockerLabel values. Check the Fargate metadata endpoint behavior; done means image labels are visible in the endpoint's Labels output, including values such as the git SHA and build version.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, docker
Domain
cloud, infrastructure
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
28/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.