Docker. How to remove bind mounts between host and container?

381 views Asked by At

I've started a Docker container with a bind mount:

docker run -it -v C:\host_folder:C:\container_folder mcr.microsoft.com/windows/server:ltsc2022 powershell

I wanted to run a couple of .exe files from that folder to do some setup.

Once I've finished my work, I wanted to remove that bind mount. How do I do that?

I have tried to edit the following config files located in:

C:\ProgramData\Docker\containers\<container identifier>

removing the part about bindings from both of them (config.v2.json and hostconfig.json) but after I restart the container, bind was still there and configs were restored.

I also created an image via

commit <container identifier> <new image name>:<new image tag>

After I ran a container based on this image, it also mounted a folder.

0

There are 0 answers