Windows-Containers icon indicating copy to clipboard operation
Windows-Containers copied to clipboard

MSVC does not support long paths inside Docker container

Open jdoubleu opened this issue 2 months ago • 1 comments

Describe the bug Apparently MSVC does not support long paths inside a Docker container. On the host, it works perfectly fine.

To Reproduce I've prepared a minimal repo: https://github.com/jdoubleu/msvc-docker-bug Steps to reproduce the behavior:

  1. clone the above repo
  2. run docker build -t msvc-docker-bug .

The Dockerfile should be self-explanatory.

Expected behavior The second compilation from the Dockerfile should work just as fine as the first one.

The behavior should match the host environment, where MSVC does not have any issues working with long paths. Even when long path support has not been enabled system-wide.

Configuration:

  • Edition: Windows 11 Pro (10.0.22631 Build 22631)
  • Base Image being used: mcr.microsoft.com/windows/servercore:ltsc2022
  • Container engine: docker
  • Container Engine version: Docker version 27.5.1, build 9f9e405

Additional information: Related issue: https://github.com/microsoft/Windows-Containers/issues/361

jdoubleu avatar Nov 06 '25 17:11 jdoubleu

Thank you for creating an Issue. Please note that GitHub is not an official channel for Microsoft support requests. To create an official support request, please open a ticket here. Microsoft and the GitHub Community strive to provide a best effort in answering questions and supporting Issues on GitHub.

github-actions[bot] avatar Nov 06 '25 17:11 github-actions[bot]

Is it woking on normal windows? As I don't think so. MSVC and msbuild has problem with long path and I also reported this issues on MS

xlazom00 avatar Dec 03 '25 20:12 xlazom00

Yes, it perfectly works fine on a normal Windows host. I've set the registry key at HKLM\SYSTEM\CurrentControlSet\Control\FileSystem in both cases.

jdoubleu avatar Dec 06 '25 17:12 jdoubleu