Cannot complete overlay FS mount within Docker container

0

Trying to use overlayfs within a Docker container.

root@din:~# mount -t overlay overlay -o lowerdir=/etc,upperdir=/oetc,workdir=/root/work /mnt
mount: /mnt: permission denied.
root@din:~# ls -ld /mnt
drwxrwxrwx 1 root root 4096 Jun 12 16:54 /mnt
root@din:~# ls -ld /oetc
drwxr-xr-x 2 root root 4096 Jul 26 19:53 /oetc
root@din:~# ls -ld /root/work
drwxr-xr-x 2 root root 4096 Jul 26 19:33 /root/work

I don't know how to identify what the permission problem is, or if it is symptomatic of something else.

Bill Michaelson

Posted 2019-07-26T20:05:51.730

Reputation: 101

Answers

0

You need to add privileges to the container.

docker run --rm -it  --cap-add=SYS_ADMIN ubuntu:latest

expelledboy

Posted 2019-07-26T20:05:51.730

Reputation: 111