1
votes

I have search for a similar problem as mine but haven't found a good solution for it. I'm trying to set up my enviroment.

The first thing we have to set up is an portainer
docker run -d -p 9000:9000 portainer/portainer

Then we trying to set up Redis
docker pull redis

start docker container
docker run -d --name redis1 -v C:\Users\xxx\docker\redis.conf:/etc/redis.conf -p 6379:6379 redis:latest

but reciving this:

C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: error while creating mount source path '/host_mnt/c/Users/xxx/docker/redis.conf': mkdir /host_mnt/c/Users/xxx: permission denied.

My settings info

PS C:\> docker info
Containers: 3
 Running: 1
 Paused: 0
 Stopped: 2
Images: 3
Server Version: 18.06.1-ce
Storage Driver: overlay2
 Backing Filesystem: extfs
 Supports d_type: true
 Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
 Volume: local
 Network: bridge host macvlan null overlay
 Log: awslogs fluentd gcplogs gelf journald json-file logentries splunk syslog
Swarm: inactive
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 468a545b9edcd5932818eb9de8e72413e616e86e
runc version: 69663f0bd4b60df09991c08812a60108003fa340
init version: fec3683
Security Options:
 seccomp
  Profile: default
Kernel Version: 4.9.93-linuxkit-aufs
Operating System: Docker for Windows
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.934GiB
Name: linuxkit-00155da11105
ID: KNBR:IKUS:M4JG:3XNK:FAT6:UNJI:NIFE:HWUA:2KXY:ULVW:CIUW:E4TH
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): true
 File Descriptors: 28
 Goroutines: 51
 System Time: 2018-10-12T13:26:05.2128058Z
 EventsListeners: 1
Registry: https://index.docker.io/v1/
Labels:
Experimental: false
Insecure Registries:
 127.0.0.0/8
Live Restore Enabled: false

I have giving the share permission to my computer and I'm a administrator on it as well. What I'm doing wrong?

2
Are you sure that filepath exists? Looks like the docker daemon is trying to create the directory for you to mount the volume and doesn't have permission. I think this shouldn't be a problem if the folder exists.maxm
I'II have reinstalled docker two times now and get the same results every time. Do not understand where it is trying to mount the volume and why it hasen't have the permission? This has become a showstopper for me.Jono

2 Answers

3
votes

I have found a fix it is to create a new users account which is the same username as your AzureAD account, but without the AzureAD prefix. Now it's working!
https://tomssl.com/2018/01/11/sharing-your-c-drive-with-docker-for-windows-when-using-azure-active-directory-azuread-aad/

1
votes

Having a similar problem (also using an AzureAD account on Windows), I could get it working by creating another non-administrator user with a different name, as well.

When the Docker user is no administrator, you need to give access to required folders individually. I noticed that you need to include their parent directories, up to your home directory.

That is, if you want to give access to C:/Users/You/Projects/Acme/ShareThis, you need to add two permissions:

  • In C:/Users/You/Projects, the docker user needs only List directory permission. This will be inherited to all subfolders and -files, including Acme.
  • In C:/Users/You/Projects/Acme/ShareThis needs either full or read-only access, depending on your needs.

You can set those permissions by right-clicking a directory, then Properties > Security tab > Edit button > Add... button. Enter the name of the docker user, press OK. Exit with OK.

Furthermore, make sure that the accessed files are not encrypted by Windows' EFS (Encrypting File System), Docker can't recognize them. However, this led to a slightly different error for me, during docker run launch:

cp: can't open '/directory/./file': Permission denied