buildx: [BUG] Failed to evaluate path "C:\\\\"

Description

When trying to run docker compose up --build it fails with Failed to evaluate path. It might have to do with that “Projects” is a NTFS mount point where my drive is mounted, and doesn’t has a drive letter assigned.

docker build works just fine, docker compose build not.

Console output:

PS C:\Projects\CadaShop> docker compose up --build     
[+] Building 0.0s (1/1) FINISHED
 => [internal] load local bake definitions                                                                                                                                                          0.0s
 => => reading from stdin 340B                                                                                                                                                                      0.0s
failed to evaluate path "C:\\Projects\\CadaShop": The system cannot find the path specified.

Shortened docker-compose.yml

services:
  myservice:
    build: .

Steps To Reproduce

  1. Clean install of Windows
  2. Create a new partition, and instead of assigning a drive letters, use a NTFS mount point
  3. Create a docker-compose.yml in your directory on the drive with build: .
  4. (Set env COMPOSE_BAKE=true)
  5. docker compose up --build

Compose Version

Docker Compose version v2.36.0-desktop.1

Docker Environment


Anything else?

No response

About this issue

  • Original URL
  • State: open
  • Created a year ago
  • Comments: 15 (11 by maintainers)

Most upvoted comments

One thing that comes to my mind is that with Go 1.23 there were some changes to how some reparse points are treated:

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)

and

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)

You might try building with winsymlink=0 and see if that solves the issue.

You might try building with winsymlink=0 and see if that solves the issue.

Ok behavior of os.Lstat in entitlements seems fixed with winreadlinkvolume=0.

@crazy-max – no idea really, but following…

Made some tests and for fs entitlements it fails here https://github.com/docker/buildx/blob/d61853bbb3eac7710ef3bfd4d48eaef662c13222/bake/entitlements.go#L609

Because file mode on the folder as mounted volume is not a dir but marked as irregular:

func TestFS(t *testing.T) {
	fi, err := os.Lstat(`C:\tmp`)
	require.NoError(t, err)
	t.Logf("File Info mode: %+v", fi.Mode())

	fi, err = os.Lstat(`C:\Test`)
	require.NoError(t, err)
	t.Logf("File Info mode: %+v", fi.Mode())
}
    foo_test.go:32: File Info mode: drwxrwxrwx
    foo_test.go:36: File Info mode: ?rw-rw-rw-

Looking at Go code base it goes through https://github.com/golang/go/blob/cfb4e9bc4ae957dba63cb2ee5e020fcd25d553fd/src/os/types_windows.go#L206 and returns https://github.com/golang/go/blob/cfb4e9bc4ae957dba63cb2ee5e020fcd25d553fd/src/os/types_windows.go#L226-L227

ok, so this issue also applies to Bake, cc @crazy-max