Skip to content

buildx(build): percent-encode git context query values - #1401

Open
sinoru wants to merge 1 commit into
docker:mainfrom
sinoru:feature/fix-github-builder#330
Open

sinoru wants to merge 1 commit into
docker:mainfrom
sinoru:feature/fix-github-builder#330

Conversation

@sinoru

@sinoru sinoru commented Oct 31, 2026

Copy link
Copy Markdown

BuildKit parses the query-format git context with Go's url.Query(), which decodes "+" as a space and treats "&", "=", "#", "%" and ";" as delimiters. Since tag refs are now passed verbatim (ref=refs/tags/...), a SemVer tag with build metadata such as v1.0.0+build.1 was resolved as "refs/tags/v1.0.0 build.1" and the build failed to load the source.

Encode each query value with encodeURIComponent per path segment so "/" stays readable while every other reserved character round-trips. The fragment format is left untouched because BuildKit reads it without decoding.

Fixes docker/github-builder#330

BuildKit parses the query-format git context with Go's url.Query(),
which decodes "+" as a space and treats "&", "=", "#", "%" and ";" as
delimiters. Since tag refs are now passed verbatim (ref=refs/tags/...),
a SemVer tag with build metadata such as v1.0.0+build.1 was resolved
as "refs/tags/v1.0.0 build.1" and the build failed to load the source.

Encode each query value with encodeURIComponent per path segment so
"/" stays readable while every other reserved character round-trips.
The fragment format is left untouched because BuildKit reads it
without decoding.

Fixes docker/github-builder#330

Signed-off-by: Kang Jaehong <sinoru@me.com>
@sinoru
sinoru force-pushed the feature/fix-github-builder#330 branch from 96a1cce to 2e27f81 Compare October 31, 2026 08:35

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tag names containing + fail to resolve

1 participant