From 42287815b5d72c4a6b62bd0b25c6723fd85a4a98 Mon Sep 17 00:00:00 2001 From: Wojciech M Date: Sun, 28 Nov 2021 22:18:57 +0100 Subject: [PATCH] add note about variable syntax in json In addition to HCL, variables can also be defined in json. Signed-off-by: wojciechem --- docs/reference/buildx_bake.md | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/docs/reference/buildx_bake.md b/docs/reference/buildx_bake.md index 16073ec5..5c60de4f 100644 --- a/docs/reference/buildx_bake.md +++ b/docs/reference/buildx_bake.md @@ -450,6 +450,28 @@ target "webapp" { } ``` +alternatively, in json format: + +```json +{ + "variable": { + "TAG": { + "default": "latest" + } + } + "group": { + "default": { + "targets": ["webapp"] + } + }, + "target": { + "webapp": { + "tags": ["docker.io/username/webapp:${TAG}"] + } + } +} +``` + ```console $ docker buildx bake --print webapp {