File tree Expand file tree Collapse file tree 1 file changed +29
-0
lines changed
content/manuals/build/bake Expand file tree Collapse file tree 1 file changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -78,6 +78,35 @@ $ docker buildx bake --print
7878}
7979```
8080
81+ ## Escape variable interpolation
82+
83+ If you want to bypass variable interpolation when parsing the Bake definition,
84+ use double dollar signs (` $${VARIABLE} ` ).
85+
86+ ``` hcl
87+ target "default" {
88+ dockerfile-inline = <<EOF
89+ FROM alpine
90+ ARG TARGETARCH
91+ RUN echo "Building for $${TARGETARCH/amd64/x64}"
92+ EOF
93+ platforms = ["linux/amd64", "linux/arm64"]
94+ }
95+ ```
96+
97+ ``` console
98+ $ docker buildx bake --progress=plain
99+ ...
100+ #8 [linux/arm64 2/2] RUN echo "Building for arm64"
101+ #8 0.036 Building for arm64
102+ #8 DONE 0.0s
103+
104+ #9 [linux/amd64 2/2] RUN echo "Building for x64"
105+ #9 0.046 Building for x64
106+ #9 DONE 0.1s
107+ ...
108+ ```
109+
81110## Using variables in variables across files
82111
83112When multiple files are specified, one file can use variables defined in
You can’t perform that action at this time.
0 commit comments