Score:0

Docker error - "cannot open path of the current working directory: Permission denied"

ng flag

I'm currently learning Docker and just migrated to an Ubuntu 20.04.2 VM running in VMware workstation player as my Raspberry Pi 2 running Debian 9 has kicked the bucket. Seems Docker requires some special permissions in Ubuntu and I'm baffled as to what those are. The primary error message when running any docker command is:

cannot open path of the current working directory: Permission denied

My home directory is NFS mounted, but UID/GID mappings between the VM and NAS are in sync, and I can create and modify files & directories in my home directory without issue. If I change the cwd to say /tmp, the error message is a little more descriptive:

j5@ubuntu20:/tmp$ docker build ~/Dockerfile
cannot create user data directory: /mnt/homes/j5/snap/docker/796: Permission denied

But the funny thing is the directory was created and has normal permissions:

j5@ubuntu20:/tmp$ ls -la /mnt/homes/j5/snap/docker/796
total 0
drwxr-xr-x 1 j5 users  0 Jul  8 01:26 .
drwxr-xr-x 1 j5 users 32 Jul  8 01:26 ..

I know Terraform has trouble creating lock files on NFS-mounted directories and am suspecting docker has a similar requirement?

Michael Hampton avatar
cz flag
You must also check permissions of all containing directories.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.