docker / docker/buildx

Document what are valid characters for a variable in a Dockerfile

Open
#1,291 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

area/dockerfile area/docs kind/docs
Dominant language
Go
Stars
4.5k
Forks
682
Avg merge
2d 14h
Merged PRs (30d)
29

Description

I was routed here from https://github.com/docker/docker.github.io/issues/8835...

From cli/docs/reference/builder.md:

Environment variables are notated in the Dockerfile either with $variable_name or ${variable_name}. They are treated equivalently and the brace syntax is typically used to address issues with variable names with no whitespace, like ${foo}_bar.

From my testing, it seems like a variable name includes alphanumeric characters and the underscore...? If this is correct, could this please be mentioned in the Dockerfile reference?

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

Review the variable-substitution section in cli/docs/reference/builder.md, especially the wording around $variable_name and ${variable_name}. Confirm which characters are valid in variable names, then document that rule in the Dockerfile reference so users can determine valid syntax without testing it themselves.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.