Docker container hangs with mount volumes

Issue Type: docker container with mounted volumes
OS Version/build: Docker Desktop on Windows 10 Enterprise Version 10.0.19045 Build 19045
App version: Docker Desktop 4.31.1 (153621)
extra information: I have C:\Users\dockerVolumes as allowed file shared folder on docker desktop settings, the folder C:\Users\dockerVolumes is configured to by ignore by the antivirus to improve performance.
Steps to reproduce: Have a container with a system folder mounted as volume for instance using docker pull ibmcom/db2:11.5.8.0 to create a container I mapped C:\Users\dockerVolumes\mydb2:/backup and after a couple of hours the container stops responding to commands, if I try ls -la inside the container I don’t have any response I cannot even delete the container I have to restart docker desktop and then recreate the container.

this does not happen if I use internal docker volumes on no persistence at all, this happens in different containers not only db2 I replicate this with a container that uses bitnami/openldap:2 image

Anyone has the same problem or a solution for this?!

Suggestion: try to search for “WSL integration” in Docker Desktop. It is better to store your data on a Linux filesystem rather than storing it on your Windows-compatible filesystem and mounting files into the virtual machine. With WSL integration you can run your docker commands from a WSL distribution and store evrything basically inside the same virtual machine. WSL2 distributions are just a kind of containers.

it is a good ideia and it works but my company blocks usage of wsl we can only use docker using hyper-v.

I not able to win that battle yet, I was underwing if this was possible with hyper-v, I manage to mount the volume but if I use the volumes it freezes the file system and I’m not even able to make a ls -la inside the container :frowning:

If you can’t use WSL, then probbaly your only option is to use HyperV to create a virtual machine and install a supprted Linux distribution inside. Then you can copy data into the virtual machine. If you want a GUI, you can try Portainer with its webinterface. Of course you won’ get the Docker Desktop features.

Maybe you can create a Linux VM with enabled nested virtualization and run Docker Desktop inside, but if you use Windows, then WSL is the recommended backend for a long time, so I don’t even remember when I last tried the hyperv backend. Probably only at the beginning. Docker Desktop has to mount files from a Windows filesystem into a Linux virtual machine and handle permissions that don’t exist on Windows the way Linux expects it So the fact it is slower is expected. Why it freezes your system, I don’t know.

You can check the GitHub repo as well to search for or send bugreports

great sugestion I will do that

thanks for the help