Introduction
Docker privileged is one of many useful features of this powerful virtualization platform. Before you start working in privileged mode, make sure you understand how it works.
In this tutorial, you will learn what privileged Docker containers are, when to use them, and whether it is a good option for you.
Docker privileged mode grants a Docker container root capabilities to all devices on the host system. Running a container in privileged mode gives it the capabilities of its host machine. For example, it enables it to modify App Arm and SELinux configurations.
With the host’s kernel features and device access, you can even install a new instance of the Docker platform within the privileged container. Essentially, this mode allows running Docker inside Docker.
Note: Learn more about Docker containers and how they differ from Docker images in Docker Image Vs Container: The Major Differences.
To check whether you are running a container in privileged mode, use the command:
docker inspect --format='{{.HostConfig.Privileged}}' [container_id]
If the container is privileged, the output responds with true
, as in the image below.