compose icon indicating copy to clipboard operation
compose copied to clipboard

Add label to all services when starting Compose stack

Open mikesir87 opened this issue 3 weeks ago • 0 comments

Description

The docker compose run command has the ability to add a label to the service. It would be nice to have that same ability when launching the entire stack.

For example:

  1. I run docker compose up --label some-key=some-value (the flag can be used multiple times)
  2. All default services are started
  3. While inspecting the containers, I see that the label some-key=some-value are on all services, networks, and volumes created by the Compose stack.

Why this is useful

While a Compose stack adds labels for the project name, it would be nice to be able to add arbitrary metadata for those stacks, especially for tooling that might managing multiple stacks (as we are now doing with Labspaces). With this metadata, we can better annotate the stacks to know which stack is which, etc.

mikesir87 avatar Dec 10 '25 01:12 mikesir87