Skip to content

setup_builder: set http/insecure only on the Docker mirror entry so buildx imagetools create can push Docker Hub manifest lists from the fallback builder (release/v2) - #151

Open
piob-io wants to merge 2 commits into
release/v2from
devin/1795020504-fallback-dockerio-https-v2
Open

piob-io wants to merge 2 commits into
release/v2from
devin/1795020504-fallback-dockerio-https-v2

Conversation

@piob-io

@piob-io piob-io commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Let docker buildx imagetools create push Docker Hub manifest lists from the fallback builder

When the action falls back to the local docker-container builder, docker buildx imagetools create -t docker.io/... fails with 404 Not Found on the manifest PUT. With this PR it pushes over HTTPS. (BLA-5188)

  • Affected: any job that ends up on the fallback builder and then pushes a manifest list to Docker Hub with buildx.
  • Not affected: the Blacksmith (remote driver) builder, which gets no config file from buildx, and BuildKit's own image pushes.

Set http and insecure only on the Blacksmith mirror's registry entry

The mirror is the only plain-HTTP endpoint, so getDockerMirrorRegistryConfig() puts the two flags only on the mirror's own entry. Docker Hub gets BuildKit's defaults.

buildx reads the docker-container builder's config for its own registry calls. http = true on docker.io made it send them to http://registry-1.docker.io; Docker Hub answers 301 to HTTPS, and the redirected PUT becomes a body-less GET.

# registry section, before             # after
[registry."docker.io"]                  [registry."docker.io"]
mirrors = ["http://<agent>:5000"]       mirrors = ["http://<agent>:5000"]
http = true
insecure = true

[registry."<agent>:5000"]               [registry."<agent>:5000"]
http = true                             http = true
insecure = true                         insecure = true

BuildKit takes a mirror's scheme and TLS settings from the mirror's own entry, so pulls still go to the mirror over HTTP.

Verify Docker Hub's TLS certificate in the Blacksmith buildkitd

buildkitd.toml for the Blacksmith builder comes from the same function, so it changes the same way. On the base branch, buildkitd talks to Docker Hub over HTTPS without certificate verification and retries over plain HTTP on a TLS error. With this PR it uses verified HTTPS only.

Checked locally (buildx v0.36.1, buildkit v0.34.2, docker-container builder)

Config buildx requests to http://registry-1.docker.io BuildKit pull reaches the HTTP mirror
before every request, all answered 301 yes
after none yes

Test in CI that Docker Hub is reached over verified HTTPS

The new Test Docker Hub HTTPS workflow runs on a Blacksmith runner against a stand-in for registry-1.docker.io (.github/scripts/dockerhub-standin.sh): TLS on :443 and, like Docker Hub, a 301 to HTTPS for every plain-HTTP request on :80.

Job Asserts
Fallback builder (no cache-key) docker buildx imagetools create pushes a manifest list; no request reaches :80
Blacksmith builder docker buildx build --push succeeds with a trusted certificate; no request reaches :80
Blacksmith builder, untrusted certificate the push fails with an x509 error

With the base branch's registry config the fallback job's push fails with the 404 Not Found (checked locally with the same script).

Not checked: the manifest push against the real Docker Hub with push credentials.

Link to Devin session: https://app.devin.ai/sessions/a2912f9d80634ddcb92d74203680bb62
Open in Devin Desktop: https://app.devin.ai/desktop/session/a2912f9d80634ddcb92d74203680bb62?variant=devin
Requested by: @piob-io


View full Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.


View full Proof
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need. (Staging)


🟢 Devin Review found nothing to fix · View findings

Devin Review

@devin-ai-integration

Copy link
Copy Markdown
Contributor

I'll fix CI failures and address comments from users with write access. I'll skip comments containing "(aside)".

  • Disable automatic comment, CI, and merge conflict monitoring

… entry

The mirror is the only plain-HTTP endpoint. With http = true on the
docker.io entry, buildx read the fallback builder's config and sent
imagetools create's manifest PUT to Docker Hub over plain HTTP; the 301 to
HTTPS turned it into a GET that returned 404. Docker Hub gets BuildKit's
defaults: HTTPS with certificate verification.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1795020504-fallback-dockerio-https-v2 branch from 66875f1 to 8356cea Compare November 18, 2026 17:04
@devin-ai-integration devin-ai-integration Bot changed the title setup_builder: keep Docker Hub on HTTPS in the fallback builder so buildx imagetools create can push manifest lists (release/v2) setup_builder: set http/insecure only on the Docker mirror entry so buildx imagetools create can push Docker Hub manifest lists from the fallback builder (release/v2) Nov 18, 2026
@piob-io
piob-io marked this pull request as ready for review November 18, 2026 17:59

@devin-ai-integration devin-ai-integration Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note

Newer findings are available below. Devin Review posted a newer report on this PR, in addition to the findings presented here.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@blacksmith-sh

blacksmith-sh Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

Matches Fallback builder pushes Docker Hub manifest list

Tested on 8356cea1, untouched since — Without this PR the fallback builder's manifest PUT went out over HTTP, was redirected and replayed as a GET, and the push failed with 404; with it every request used HTTPS and the manifest list was pushed. Against real Docker Hub, buildx's plain-HTTP requests and 301s also disappear.

Merge-base

Push to Hub stand-in

This PR 8356cea1

Push to Hub stand-in

Merge-base

Real Docker Hub

This PR 8356cea1

Real Docker Hub

Also checked · 3 match

Matches Pulls still go through the HTTP mirror
Matches buildkitd verifies Docker Hub TLS
Matches New CI check catches the HTTP regression

Proof on b29c7f96 (from 019d4598) · mocked: Blacksmith Docker Hub mirror (the VM agent's mirror at <agent>:5000 exists only on Blacksmith runners; a regis...), Docker Hub (needs DOCKERHUB_USERNAME, DOCKERHUB_TOKEN) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

@blacksmith-staging

blacksmith-staging Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Matches imagetools create pushes to Docker Hub from fallback builder

Tested on 8356cea1, untouched since — Without this PR buildx sent Docker Hub calls over HTTP, the redirected manifest PUT became a GET and failed with 404; with it every call went over HTTPS and the tag was pushed. Docker Hub stood in by a local registry that redirects like the real one.

Merge-base

Manifest push

This PR 8356cea1

Manifest push

Real Hub redirect

Also checked · 2 match

Matches Pulls still go through the HTTP mirror
Matches Blacksmith buildkitd verifies Docker Hub TLS

Proof on b29c7f96 (from 019d4598) · mocked: Docker Hub (registry-1.docker.io) (needs DOCKERHUB_USERNAME, DOCKERHUB_TOKEN), Blacksmith Docker Hub mirror (the agent's mirror only exists on Blacksmith runners; a registry:2 pull-through...) · Did Proof get it right? Yes · No

View full Proof report · React 👎 or comment @codesmith dismiss this proof to dismiss

github-advanced-security[bot]

This comment was marked as resolved.

A stand-in for registry-1.docker.io runs on the runner: TLS on :443 and,
like Docker Hub, a 301 to HTTPS for every plain-HTTP request on :80.

- fallback builder: `buildx imagetools create` pushes a manifest list
  and no request reaches :80.
- Blacksmith builder: `buildx build --push` succeeds with a trusted
  certificate and fails on x509 with an untrusted one.

Co-Authored-By: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@devin-ai-integration
devin-ai-integration Bot force-pushed the devin/1795020504-fallback-dockerio-https-v2 branch from 019d459 to b29c7f9 Compare November 18, 2026 18:32

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

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.

3 participants