Skip to content

Add labels when using Dockerfile or Compose - #929

Open
Roman (Roemer) wants to merge 2 commits into
devcontainers:mainfrom
Roemer:debug/label-in-container-from-dockerfile
Open

Roman (Roemer) wants to merge 2 commits into
devcontainers:mainfrom
Roemer:debug/label-in-container-from-dockerfile

Conversation

@Roemer

@Roemer Roman (Roemer) commented Nov 7, 2024 •

Copy link
Copy Markdown

This PR adds the possibility to add labels when using a Dockerfile or Compose.

@johnitvn

Copy link
Copy Markdown

I have encountered this error in practice. Hope this error will be fixed soon.

@chrmarti

Copy link
Copy Markdown
Contributor

We are passing them on here for images:

...params.additionalLabels.length > 0 ? params.additionalLabels.map(label => ['--label', label]).flat() : [],

This is missing here:

It is also missing on the Docker Compose code path. Docker Compose doesn't add labels to the built images, it adds them to the containers.

@Roemer
Roman (Roemer) force-pushed the debug/label-in-container-from-dockerfile branch from 8969b03 to c6c1042 Compare August 25, 2025 15:36
@Roemer
Roman (Roemer) force-pushed the debug/label-in-container-from-dockerfile branch 4 times, most recently from bc1443b to fc10eb3 Compare August 25, 2025 20:27
@Roemer

Roman (Roemer) commented Aug 25, 2025 •

Copy link
Copy Markdown
Author

I actually gave it a try and implemented it in this PR, so it is ready for review.

@Roemer Roman (Roemer) changed the title Added test for labels with dockerfile Add labels when using Dockerfile or Compose Aug 25, 2025

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants