如何避免在这个泊坞窗会话结束时以下错误消息中禁用:为什么mount命令是一个码头工人容器
$ docker run -it ubuntu /bin/bash
[email protected]:/# ls
bin boot dev etc home lib lib64 media mnt opt proc root run sbin srv sys tmp usr var
[email protected]:/# cd home/
[email protected]:/home# ls
[email protected]:/home# mkdir 1
[email protected]:/home# mkdir 2
[email protected]:/home# mount --bind 1 2
mount: block device /home/1 is write-protected, mounting read-only
mount: cannot mount block device /home/1 read-only
更新:
$ docker run --cap-add=SYS_ADMIN -it ubuntu /bin/bash
[email protected]:/# cd home/
[email protected]:/home# mkdir 1
[email protected]:/home# mkdir 2
[email protected]:/home# mount --bind 1 2
mount: block device /home/1 is write-protected, mounting read-only
mount: cannot mount block device /home/1 read-only
[email protected]:/home# exit
$ docker run --cap-add=ALL -it ubuntu /bin/bash
[email protected]:/# cd home/
[email protected]:/home# mkdir 1
[email protected]:/home# mkdir 2
[email protected]:/home# mount --bind 1 2
mount: block device /home/1 is write-protected, mounting read-only
mount: cannot mount block device /home/1 read-only
[email protected]:/home# exit
--privileged是所有虽然。
好的意见。 +1 – VonC