docker / docker/cli

[Docker Swarm] : Environment variable in labels

Open
#6,150 1 comment 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area/stack area/swarm kind/feature status/0-triage
Dominant language
Go
Stars
6.1k
Forks
2.2k
Avg merge
1d 15h
Merged PRs (30d)
43

Description

Description

Hello,

I hope you’re doing well.

I’m using Docker Swarm, which I really appreciate overall.
However, I’ve run into an issue that, in my opinion, shouldn’t even exist today: it’s still impossible to use environment variables inside labels.

For example:

labels:
  - "my.label=${ENV_VARIABLE}"

Unfortunately, this kind of variable substitution is still not supported, even though it seems like a simple and extremely useful feature especially for things like Traefik.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No file or test is named. Start by tracing Docker Swarm label handling and existing environment-variable substitution behavior in the Docker CLI; define the expected ${ENV_VARIABLE} semantics and verify them with a Swarm-focused test. Done means environment variables can be used in labels as shown.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
cli, devops
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.