Docker Community Forums

Share and learn in the Docker community.

Permission denied on volume

docker

#1

Hi,
I’m trying to mount a volume in a folder with specfic permissions:

docker run -v /opt/group_folder/test:/var --user $(id -u):30138 my_image bash

And I get:

docker: Error response from daemon: error while creating mount source path ‘/opt/group_folder/test’: mkdir /opt/group_folder/test: permission denied.

The group_folder folder has these persmissions:
drwxrwx--- 3 root some_group 4096 Jan 4 11:30 group_folder
The some_group gid is: 30138.

I’m using Docker version 18.09.0, build 4d60db4 on Ubuntu 16.04.5 LTS.

Am I missing something here ?

Thanks