Privileged containers
By default, containers run in unprivileged mode, that is, we cannot run Docker daemon inside a Docker container. However, the privileged Docker container is given access to all the devices. Docker privileged mode allows access to all the devices on the host and sets system configuration in App Armor and SELinux to allow containers the same access as the process running on the host:
Privileged container highlighted in red
The privileged containers can be started with the following command:
$ docker run -it --privileged ubuntu /bin/bash root@9ab706a6a95c:/# cd /dev/ root@9ab706a6a95c:/dev# ls agpgart hdb6 psaux sg1 tty32 tty7 atibm hdb7 ptmx shm tty33 tty8 audio hdb8 pts snapshot tty34 tty9 beep hdb9 ram0 sr0 tty35 ttyS0
As we can see, after starting the container in privileged mode, we can list all the devices connected to the...