docker --privileged
时间: 2023-06-05 18:47:13 浏览: 730
docker --privileged是Docker运行时的一个选项,它允许容器内的进程拥有主机上的root权限。这个选项可以用来运行一些需要特权的应用程序,比如一些网络应用程序或者需要访问主机硬件的应用程序。但是,使用这个选项也会增加安全风险,因为容器内的进程可以对主机进行更多的操作。因此,建议只在必要的情况下使用这个选项。
相关问题
docker--privileged
The `--privileged` flag in Docker allows a container to have access to all devices on the host system, including the kernel and hardware resources. This means that the container will have full root privileges and can perform any action that the host can perform, such as mounting file systems, changing network settings, and modifying kernel parameters.
Using the `--privileged` flag can be useful for running certain types of applications that require more access to the host system than a normal container would have. However, it can also be risky, as it can potentially compromise the security of the host system if the container is compromised.
It is generally recommended to avoid using the `--privileged` flag unless absolutely necessary, and to use more granular options such as `--cap-add` and `--device` to grant specific privileges as needed.
docker --privileged=true
docker --privileged=true 是一个Docker命令,用于启动一个特权容器。这样的容器可以访问主机的所有设备和文件系统,并能够执行一些需要较高权限的操作。这个命令通常用于测试、网络和存储方面的应用程序。