Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Docker for Windows : volumes are empty

I updated from Windows 7 to Windows 10 few weeks ago : I was using Docker Toolbox/Virtual Box to work with Docker and I read Docker for Windows was recommended (newest application) but it is a pain for me to make it work as it used to with Toolbox.

I created a docker machine using hyperv and running docker hello-world works.

But when it comes to use volumes, a strange behavior happens : No error messages, container working perfectly but my volume is empty of files inside, I only have folders.

I used to have troubles with Shared Drives but I managed to have it working (through Docker for Win GUI).

Here is a command I try which run a container but does not map Windows files (only folders) :

docker run -ti -v folders/:data/folder alpine

I am running Docker version 18.03.0-ce

Any idea? If I am not clear, please let me give more information! Thx

like image 232
Marien Avatar asked Apr 25 '18 09:04

Marien


People also ask

Where are volumes stored in Windows Docker?

Where are stored docker volumes Windows? Volumes are stored in a part of the host filesystem which is managed by Docker ( /var/lib/docker/volumes/ on Linux).

Why is Docker not working Windows 10?

Operating System. If you do not run a 64-bit version of Windows Windows 10 Pro, Enterprise, or Education; 1511 November update, Build 10586 or later, you cannot run Docker for Windows. You can install Docker Toolbox if you have a 64-bit version of Windows 7 or later. Alternately, you do have the option to upgrade.

Where are Docker volumes stored Windows wsl2?

Where are docker volumes stored on Windows wsl2? The files could be found on Windows in \\wsl$\docker-desktop-data\version-pack-data\community\docker\containers .


1 Answers

First make sure that your drive is shared (see image below).

One important note is that if you change your windows password then your shared drives will not be able to mount. To fix this simply unshare and reshare your drive or press "Reset credentials...".

Thanks to ctliv for pointing that out in this discussion: https://github.com/docker/for-win/issues/25

enter image description here

like image 154
Paul Adam Avatar answered Sep 18 '22 16:09

Paul Adam