I am unsure if this is related to docker or ubuntu. I got a docker image from coworker and working inside it. I created a container based on the image with volume mapping to host system like docker run -it -v /data/dira:/dira image_from_coworker
, and tried to create new directory under /dira
using command mkdir /dira/test
, but it fails with permission denied message:
# inside the container
I have no name!@7aa44e2d4926:/dirk$ ls -ald /dira
drwxrwxrwx+ 4 root root 4096 Jul 18 23:19 /dira
I have no name!@7aa44e2d4926:/dirk$ mkdir /dira/test
mkdir: cannot create directory '/dira/test': Permission denied
I have no name!@7aa44e2d4926:/dirk$ id
uid=1000 gid=0(root) groups=0(root)
Since /dira
has 777 permission, as my best knowledge, anyone can access and write something under the directory. But I couldn’t do. It is so strange. I also noticed there is +
symbol at /dira
and inspected the ACL, but there looked no special things.
# I checked the ACL from host since the guest doesn't have getfacl command installed.
(base) $ getfacl /data/dira/
# file: data/dira/
# owner: root
# group: root
user::rwx
group::r-x
group:sudo:rwx
mask::rwx
other::rwx
default:user::rwx
default:group::r-x
default:group:sudo:rwx
default:mask::rwx
default:other::r-x
Could anyone help me out with resolving this?
About the host and guest systems.
# host
(base) $ uname -r
6.5.0-35-generic
(base) $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 22.04.3 LTS
Release: 22.04
Codename: jammy
# guest
I have no name!@7aa44e2d4926:/dirk$ uname -r
6.5.0-35-generic
I have no name!@7aa44e2d4926:/dirk$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 20.04.5 LTS
Release: 20.04
Codename: focal
More about the /data
: this directory is a hard drive mounted on the host system.
(base) $ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 26G 11M 26G 1% /run
/dev/mapper/vgubuntu-root 1.7T 1.4T 278G 84% /
tmpfs 126G 0 126G 0% /dev/shm
tmpfs 5.0M 4.0K 5.0M 1% /run/lock
efivarfs 128K 31K 93K 25% /sys/firmware/efi/efivars
/dev/nvme0n1p1 511M 6.1M 505M 2% /boot/efi
/dev/sda1 7.0T 4.9T 1.8T 74% /data
...
Thanks for your concerning!