diff --git a/content/manuals/build/building/variables.md b/content/manuals/build/building/variables.md index 4f843741dc..75c1e9ca54 100644 --- a/content/manuals/build/building/variables.md +++ b/content/manuals/build/building/variables.md @@ -331,6 +331,7 @@ They're used to configure the Buildx client, or the BuildKit daemon. | [BUILDX_NO_DEFAULT_ATTESTATIONS](#buildx_no_default_attestations) | Boolean | Turn off default provenance attestations. | | [BUILDX_NO_DEFAULT_OCI_ARTIFACT](#buildx_no_default_oci_artifact) | Boolean | Turn off OCI artifact storage for attestations by default. | | [BUILDX_NO_DEFAULT_LOAD](#buildx_no_default_load) | Boolean | Turn off loading images to image store by default. | +| [BUILDX_SEND_GIT_QUERY_AS_INPUT](#buildx_send_git_query_as_input) | Boolean | Resolve Git URL queries in Buildx for frontend compatibility. | | [EXPERIMENTAL_BUILDKIT_SOURCE_POLICY](#experimental_buildkit_source_policy) | String | Specify a BuildKit source policy file. | BuildKit also supports a few additional configuration parameters. Refer to @@ -808,4 +809,26 @@ Usage: $ export BUILDX_NO_DEFAULT_LOAD=1 ``` +### BUILDX_SEND_GIT_QUERY_AS_INPUT + +Set `BUILDX_SEND_GIT_QUERY_AS_INPUT=1` to use Git URL queries with a BuildKit +daemon or Dockerfile frontend that doesn't support the Git query-string +format. Buildx resolves the Git URL into a source input instead of requiring +the frontend to interpret the query. The default is `false`. + +For example, select a tag and verify its commit while using an older builder: + +```console +$ BUILDX_SEND_GIT_QUERY_AS_INPUT=1 docker buildx build \ + 'https://github.com/moby/buildkit.git?tag=v0.21.1&checksum=66735c67' +``` + +This applies to the main Git context and additional Git contexts that use +URL queries. It changes how the context is represented in provenance: +the context is supplied as a source input instead of the usual context +string. If you consume provenance, account for that difference before +enabling the setting in your workflow. + +See [Git URL queries](../concepts/context.md#url-queries) for query syntax. + diff --git a/content/manuals/build/concepts/context.md b/content/manuals/build/concepts/context.md index 3623602b34..88a6da1e5c 100644 --- a/content/manuals/build/concepts/context.md +++ b/content/manuals/build/concepts/context.md @@ -289,6 +289,11 @@ $ docker buildx build 'https://github.com/user/myrepo.git?tag=v0.1.0&commit=dead > Short commit hash is supported with `checksum` (alias `commit`) query but for > `ref`, only the full hash of the commit is supported. +If your BuildKit daemon or Dockerfile frontend doesn't support URL queries, +set `BUILDX_SEND_GIT_QUERY_AS_INPUT=1` to let Buildx resolve them. This changes +the context's provenance representation; see the +[compatibility setting](../building/variables.md#buildx_send_git_query_as_input). + #### Keep `.git` directory By default, BuildKit doesn't keep the `.git` directory when using Git contexts.