cli icon indicating copy to clipboard operation
cli copied to clipboard

Docker Cli legacy build deprecated on windows with no replacement available

Open nrcventura opened this issue 8 months ago • 4 comments

Description

When attempting to build windows docker images from windows github runners, the docker cli reports an error that the legacy builder is deprecated.

     DEPRECATED: The legacy builder is deprecated and will be removed in a future release.
                 Install the buildx component to build images with BuildKit:
                 https://docs.docker.com/go/buildx/

The problem is that buildx and buildkit do not work well on windows, and any support for them is still experimental.

Either this warning is being incorrectly applied when attempting to build windows containers, or this deprecation is happening before windows containers can be supported by the newer build systems.

See https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/pull/4876 for an attempt to enable buildx and buildkit on a github windows runner and a link to an example job that failed with the legacy builder deprecation message.

Reproduce

  1. Setup a github actions job to run on a windows runner
  2. Use the docker cli to build a windows container.
  3. Sometimes it will successfully, and other times it fails with the deprecation message.

Expected behavior

Either the windows docker containers should continue to built using the legacy builder, or the newer build system needs to fully support windows containers.

docker version

N/A

docker info

N/A

Additional Info

See https://github.com/actions/runner-images/blob/main/images/windows/Windows2025-Readme.md for the information about which docker tools (and their versions) are installed on windows runners.

nrcventura avatar Mar 10 '26 20:03 nrcventura

It's possible that this may be a github only issue. The docker info and docker version commands fail periodically when run on github windows runners.

Run docker version
  docker version
  docker info
  shell: C:\Program Files\PowerShell\7\pwsh.EXE -command ". '{0}'"
  env:
    AGENT_VERSION: latest
Client:
failed to connect to the docker API at npipe:////./pipe/docker_engine; check if the path is correct and if the daemon is running: open //./pipe/docker_engine: The system cannot find the file specified.
 Version:           29.1.5
 API version:       1.52
 Go version:        go1.25.6
 Git commit:        0e6fee6
 Built:             Fri Jan 16 12:51:08 2026
 OS/Arch:           windows/amd64
 Context:           default
Client:
failed to connect to the docker API at npipe:////./pipe/docker_engine; check if the path is correct and if the daemon is running: open //./pipe/docker_engine: The system cannot find the file specified.
 Version:    29.1.5
 Context:    default
 Debug Mode: false
 Plugins:
  compose: Docker Compose (Docker Inc.)
    Version:  v2.40.3
    Path:     C:\ProgramData\Docker\cli-plugins\docker-compose.exe

Server:
Error: Process completed with exit code 1.

nrcventura avatar Mar 23 '26 16:03 nrcventura

Thanks for the update; that COULD indeed explain the stray deprecation warning; the legacy builder is deprecated for Linux daemons (we'll likely continue to have the /build endpoint through the REST API, but it will be limited as not all BuildKit features can be expressed through the REST API).

But for Windows daemons, BuildKit is not (yet) the default; there's support now, but it requires the containerd image store, and with containerd used as runtime.

The CLI already assumes BuildKit to be the default, unless it knows the daemon doesn't support it; so in the case the daemon isn't running, it's not able to connect with the API to check, and ... I suspect it will then fallback to the default (assume it's supported by the daemon, so if you're not using buildx as client, it prints a warning).

I'd have to check though, because I recall the logic for handling the fallbacks was ... rather involved.

thaJeztah avatar Mar 24 '26 00:03 thaJeztah

Building Windows containers with buildx still isn't possible on Windows. When running I get the error "did not complete successfully: buildkit executor not implemented for windows"

AGregersen avatar May 29 '26 06:05 AGregersen

https://github.com/actions/runner-images/issues/13729 is related to this issue, and it describes a workaround that can be used.

nrcventura avatar Jun 04 '26 21:06 nrcventura