Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File handle of executable is not closed after execution of the file if the file is on a docker volume #559

Open
friedrichatgc opened this issue Dec 12, 2024 · 2 comments
Labels
🔖 ADO Has corresponding ADO item bug Something isn't working

Comments

@friedrichatgc
Copy link

Describe the bug
When a container executes a executable file (*.exe) which is placed inside a docker volume than vmwp.exe keeps a open handle to this file forever (until the container exists).
Hence, e.g. deleting the file after the executable has finished is not possible.
(at least if the container is running in HyperV isolation)

To Reproduce
Run the following steps in a cmd shell:

REM create a host-dir for a docker volume
mkdir .\content

REM copy a executable to the host-dir of a docker volume
copy c:\Windows\System32\xcopy.exe .\content

REM run a docker container which executes the above executable and then tries to delete this executable -> ERROR the executable is still opened by vmwp.exe
docker.exe run --isolation=hyperv -v .\content:c:/content mcr.microsoft.com/windows/nanoserver:ltsc2019 cmd /c "c:\content\xcopy.exe & del c:\content\xcopy.exe"

Expected behavior
The del command should not fail with the error message "Access is denied".
The reason for this seems to be that vmwp.exe still has a open handle to xcopy.exe.
It works if the executable is not on a docker volume but stored direct in the container.
It also works if the executable is not executed before the delete.

Configuration:

  • Edition: Windows 10 Pro
  • Base Image being used: nanoserver:ltsc2019
  • Container engine: docker
  • Container Engine version docker 27.3.1 (server and client)
@friedrichatgc friedrichatgc added bug Something isn't working triage New and needs attention labels Dec 12, 2024
Copy link

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.

@ntrappe-msft
Copy link
Contributor

@friedrichatgc Hey, thanks for bringing this up. We'll repro this as soon as we can.

@ntrappe-msft ntrappe-msft added 🔖 ADO Has corresponding ADO item and removed triage New and needs attention labels Dec 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔖 ADO Has corresponding ADO item bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants