docs: use homedir() in the bake ssh --set example

Signed-off-by: Matt Van Horn <455140+mvanhorn@users.noreply.github.com>
This commit is contained in:
Matt Van Horn
2026-07-25 08:27:46 -07:00
parent aabd19eb6b
commit 118884e052
+3 -3
View File
@@ -508,11 +508,11 @@ $ docker buildx bake --set "*.ssh=default=$HOME/.ssh/id_ed25519,$HOME/.ssh/id_rs
``` ```
Your shell expands `$HOME` before buildx sees the value. The equivalent Bake Your shell expands `$HOME` before buildx sees the value. The equivalent Bake
file definition uses the resolved paths directly (Bake doesn't expand `$HOME` file definition uses the
in HCL strings): [`homedir`](https://docs.docker.com/build/bake/stdlib/#homedir) HCL function:
```hcl ```hcl
target "default" { target "default" {
ssh = [{ id = "default", paths = ["/home/user/.ssh/id_ed25519", "/home/user/.ssh/id_rsa"] }] ssh = [{ id = "default", paths = ["${homedir()}/.ssh/id_ed25519", "${homedir()}/.ssh/id_rsa"] }]
} }
``` ```