Skip to content

Add label to all services when starting Compose stack #13436

@mikesir87

Description

@mikesir87

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions