Merge pull request #6937 from devendrakushwah80/docs/workdir-tilde-note

docs: clarify WORKDIR tilde path behavior
This commit is contained in:
Tõnis Tiigi
2026-07-19 10:17:18 -07:00
committed by GitHub
2 changed files with 12 additions and 0 deletions

View File

@@ -28,6 +28,12 @@ image built externally is prone to breaking, since working directory may change
upstream without warning, resulting in a completely different directory
hierarchy for your build.
> [!NOTE]
>
> `WORKDIR` does not perform shell expansion. Paths beginning with `~` or
> `~username` are treated as literal directory names and are not resolved to a
> user's home directory.
## Examples
❌ Bad: this assumes that `WORKDIR` in the base image is `/`

View File

@@ -20,6 +20,12 @@ image built externally is prone to breaking, since working directory may change
upstream without warning, resulting in a completely different directory
hierarchy for your build.
> [!NOTE]
>
> `WORKDIR` does not perform shell expansion. Paths beginning with `~` or
> `~username` are treated as literal directory names and are not resolved to a
> user's home directory.
## Examples
❌ Bad: this assumes that `WORKDIR` in the base image is `/`