Skip to content

build: report docker feature detection failures - #4082

Merged
crazy-max merged 1 commit into
docker:masterfrom
crazy-max:fix-docker-feature-detection
Sep 30, 2026
Merged

crazy-max merged 1 commit into
docker:masterfrom
crazy-max:fix-docker-feature-detection

Conversation

@crazy-max

@crazy-max crazy-max commented Sep 16, 2026 •

Copy link
Copy Markdown
Member

fix partially #3266

Return Docker feature detection errors instead of reporting unsupported manifest lists, and cache only successful results per Docker context so failed probes can be retried. Probe the builder daemon for the docker driver and the load destination for other drivers, while skipping daemon detection for tarball exports.

The driver-level ListWorkers feature cache has a similar error-handling issue and can be addressed in a follow-up:

d.features.once.Do(func() {
var useContainerdSnapshotter bool
if c, err := d.Client(ctx); err == nil {
workers, _ := c.ListWorkers(ctx)
for _, w := range workers {
if _, ok := w.Labels["org.mobyproject.buildkit.worker.snapshotter"]; ok {
useContainerdSnapshotter = true
}
}
c.Close()
}
d.features.list = map[driver.Feature]bool{
driver.OCIExporter: useContainerdSnapshotter,
driver.DockerExporter: useContainerdSnapshotter,
driver.CacheExport: useContainerdSnapshotter,
driver.MultiPlatform: useContainerdSnapshotter,
driver.DirectPush: useContainerdSnapshotter,
driver.PreferImageDigest: useContainerdSnapshotter,
driver.DefaultLoad: true,
}
})

Its Features interface cannot return errors, so simply allowing failed probes to retry could change capability results midway through a build. An early failure could disable default provenance, while a later successful probe allows the build to proceed without it. Fixing that safely requires propagating detection errors through the driver interface and its callers, which is broader than this targeted fix.

@crazy-max
crazy-max force-pushed the fix-docker-feature-detection branch from fe2f340 to 269936e Compare September 16, 2026 13:30
@crazy-max crazy-max added this to the v0.38.0 milestone Sep 16, 2026
@crazy-max
crazy-max marked this pull request as ready for review September 16, 2026 13:46
Return daemon probe errors instead of treating them as unsupported features. Cache only successful results
per docker context so failed or canceled probes can be retried.

Probe the builder endpoint for the docker driver and the load destination for other drivers. Skip daemon
detection for tarball exports, and cover retries, cancellation, concurrent lookups, and exporter probe selection.

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max
crazy-max force-pushed the fix-docker-feature-detection branch from 269936e to 56113fc Compare September 29, 2026 18:10

@tonistiigi tonistiigi left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Potential follow ups from agents:

@crazy-max
crazy-max merged commit e3fa890 into docker:master Sep 30, 2026
162 checks passed
@crazy-max
crazy-max deleted the fix-docker-feature-detection branch September 30, 2026 13:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants