Book Image

Troubleshooting Docker

By : Vaibhav Kohli, Rajdeep Dua, John Wooten
Book Image

Troubleshooting Docker

By: Vaibhav Kohli, Rajdeep Dua, John Wooten

Overview of this book

You?re pro Docker? You?ve read all about orchestration with Docker in books? Now learn how to troubleshoot Docker in practice. Gain all the tools to safely see Docker in action with this 2017 book.
Table of Contents (17 chapters)
Troubleshooting Docker
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Customer Feedback
Preface
Free Chapter
1
Understanding Container Scenarios and an Overview of Docker

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...