Fix the volume mounted is empty on Windows 10 [docker v.18.06.1]

The volume mounted into a docker container is empty on Windows 10. I fixed the issue by reset credentials by using Kitematic.
Error condition:
docker run --rm -v /d/temp:/data centos:centos7 ls -lht /data
The above command returns
total 0
which means /data on container is an empty folder. But the host folder d:/temp is not empty folder on Windows 10.

Solutions:

Maybe because my windows password have been changed several months ago.

1. Click the docker icon on lower right corner of desktop. And click the "Settings".

2. Switch to the label: Shared Drives

3. Click "Reset Credentials" on lower center region.

4. Enable which drive you want to shared. And click the "Apply".

5. Enter the Windows account and password

Other error message:
docker: Error response from daemon: error while creating mount source path '/host_mnt/d/temp': mkdir /host_mnt/d: file exists.


Versions:
Docker Version 18.06.1-ce-win73 (19507)

Other trivial approaches:
  • Run the command line as Administrator.
  • Run the Docker as Administrator.
  • Grant more permission for the account: User on the shared host folder.
References:

Materials:
Docker Icons - Free Download, PNG and SVG (Thanks, icons8!)


留言