Skip to content

build: report docker feature detection failures - #4082

Open
crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-docker-feature-detection
Open

crazy-max wants to merge 1 commit into
docker:masterfrom
crazy-max:fix-docker-feature-detection

Conversation

@crazy-max

Copy link
Copy Markdown
Member

fixes #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.

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 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
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.

Feature detection caches features as not available if a builder is polled before it is fully initialized

1 participant