Skip to content

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Aug 27, 2025

fixes #3221

Since Go 1.23, reparse points are not read anymore:

On Windows, the mode bits reported by Lstat and Stat for reparse points changed. Mount points no longer have ModeSymlink set, and reparse points that are not symlinks, Unix sockets, or dedup files now always have ModeIrregular set. This behavior is controlled by the winsymlink setting. For Go 1.23, it defaults to winsymlink=1. Previous versions default to winsymlink=0.
(from https://go.dev/doc/go1.23#ospkgos)

...

On Windows, EvalSymlinks no longer evaluates mount points, which was a source of many inconsistencies and bugs. This behavior is controlled by the winsymlink setting. For Go 1.23, it defaults to winsymlink=1. Previous versions default to winsymlink=0.
(from https://go.dev/doc/go1.23#pathfilepathpkgpathfilepath)

And therefore files within a NTFS folder using a mounted volume can't be read when building. Either the context or Dockerfile:

FROM busybox
RUN echo hello
> docker buildx build .
[+] Building 0.1s (1/1) FINISHED                                                                   docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 2B                                                                                 0.0s
ERROR: failed to solve: failed to read dockerfile: open Dockerfile: no such file or directory

We can restore the previous behavior by setting winsymlink=0 in our go.mod using the godebug directive that pins runtime behavior independently of the go language version.

Before:

> docker buildx build .
[+] Building 0.1s (1/1) FINISHED                                                                   docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 2B                                                                                 0.0s
ERROR: failed to build: failed to run Build function: failed to read dockerfile: open Dockerfile: no such file or directory

After:

> docker buildx build .
[+] Building 0.4s (6/6) FINISHED                                                                   docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                               0.0s
 => => transferring dockerfile: 65B                                                                                0.0s
 => [internal] load metadata for docker.io/library/busybox:latest                                                  0.1s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 2B                                                                                    0.0s
 => [1/2] FROM docker.io/library/busybox:latest@sha256:f85340bf132ae937d2c2a763b8335c9bab35d6e8293f70f606b9c6178d  0.0s
 => => resolve docker.io/library/busybox:latest@sha256:f85340bf132ae937d2c2a763b8335c9bab35d6e8293f70f606b9c6178d  0.0s
 => CACHED [2/2] RUN echo hello                                                                                    0.0s
 => exporting to image                                                                                             0.1s
 => => exporting layers                                                                                            0.0s
 => => exporting manifest sha256:aba0e7cc9ba36a377761381a6545bd136e126fd978a3828a92ec18e68631c677                  0.0s
 => => exporting config sha256:0664101238d194cd8ccc6ca3659cb0aa3709b3f02092e1d70b01866919439fcb                    0.0s
 => => exporting attestation manifest sha256:cf1ae7848a2002c73b8945a7563e8302013b000c6cb40dd74898591c82beb047      0.0s
 => => exporting manifest list sha256:c0b95700bc421c6c1bcfbaaffa23922521abb36371273924cfe47a0e76186196             0.0s
 => => naming to moby-dangling@sha256:c0b95700bc421c6c1bcfbaaffa23922521abb36371273924cfe47a0e76186196             0.0s
 => => unpacking to moby-dangling@sha256:c0b95700bc421c6c1bcfbaaffa23922521abb36371273924cfe47a0e76186196          0.0s

Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
@crazy-max crazy-max requested a review from tonistiigi August 27, 2025 13:24
@crazy-max crazy-max marked this pull request as ready for review August 27, 2025 13:32
@crazy-max crazy-max added this to the v0.28.0 milestone Aug 27, 2025
@tonistiigi tonistiigi merged commit 026e55b into docker:master Aug 27, 2025
138 checks passed
@crazy-max crazy-max deleted the winsymlink0 branch August 27, 2025 15:39
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.

[BUG] Failed to evaluate path "C:\\<Mounted Drive>\\<Directory on Drive>"
2 participants