From 74d3c626f158394a0045823f05a1ba275074e5d6 Mon Sep 17 00:00:00 2001 From: Devendra Kushwah Date: Tue, 7 Jul 2026 23:21:19 +0530 Subject: [PATCH] docs: clarify WORKDIR tilde path behavior Signed-off-by: Devendra Kushwah --- frontend/dockerfile/docs/rules/workdir-relative-path.md | 6 ++++++ frontend/dockerfile/linter/docs/WorkdirRelativePath.md | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/frontend/dockerfile/docs/rules/workdir-relative-path.md b/frontend/dockerfile/docs/rules/workdir-relative-path.md index 06043ea15..396be3e27 100644 --- a/frontend/dockerfile/docs/rules/workdir-relative-path.md +++ b/frontend/dockerfile/docs/rules/workdir-relative-path.md @@ -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 `/` diff --git a/frontend/dockerfile/linter/docs/WorkdirRelativePath.md b/frontend/dockerfile/linter/docs/WorkdirRelativePath.md index e40c9a000..7778298a4 100644 --- a/frontend/dockerfile/linter/docs/WorkdirRelativePath.md +++ b/frontend/dockerfile/linter/docs/WorkdirRelativePath.md @@ -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 `/`