Which docker run` flag lifts cgroup limitations?
The --privileged flag lifts all the cgroup limitations for a container, as well as other security restrictions imposed by the Docker daemon1. This gives the container full access to the host's devices, resources, and capabilities, as if it was running directly on the host2. This can be useful for certain use cases that require elevated privileges, such as running Docker-in-Docker or debugging system issues3. However, using the --privileged flag also poses a security risk, as it exposes the host to potential attacks or damages from the container4. Therefore, it is not recommended to use the --privileged flag unless absolutely necessary, and only with trusted images and containers.
The other options are not correct because they do not lift all the cgroup limitations for a container, but only affect specific aspects of the container's resource allocation or isolation:
* The --cpu-period flag sets the CPU CFS (Completely Fair Scheduler) period for a container, which is the length of a CPU cycle in microseconds. This flag can be used in conjunction with the --cpu-quota flag to limit the CPU time allocated to a container. However, this flag does not affect other cgroup limitations, such as memory, disk, or network.
* The --isolation flag sets the isolation technology for a container, which is the mechanism that separates the container from the host or other containers. This flag is only available on Windows containers, and can be used to choose between process, hyperv, or process-isolated modes. However, this flag does not affect the cgroup limitations for a container, but only the level of isolation from the host or other containers.
* The --cap-drop flag drops one or more Linux capabilities for a container, which are the privileges that a process can use to perform certain actions on the system. This flag can be used to reduce the attack surface of a container by removing unnecessary or dangerous capabilities. However, this flag does not affect the cgroup limitations for a container, but only the capabilities granted to the container by the Docker daemon.
* Runtime privilege and Linux capabilities
* Docker Security: Using Containers Safely in Production
* Docker run reference
* Docker Security: Are Your Containers Tightly Secured to the Ship? SlideShare
* [Secure Engine]
* [Configure a Pod to Use a Limited Amount of CPU]
* [Limit a container's resources]
* [Managing Container Resources]
* [Isolation modes]
* [Windows Container Isolation Modes]
* [Windows Container Version Compatibility]
* [Docker and Linux Containers]
* [Docker Security Cheat Sheet]
* [Docker Security: Using Containers Safely in Production]
Jackie
1 months agoClarinda
2 months agoBrittni
5 hours agoDoretha
27 days agoMarjory
2 months agoAliza
2 months agoTashia
2 months agoLeslee
10 days agoRuth
11 days agoMonte
15 days agoAshleigh
21 days agoAnnamae
2 months agoCaitlin
2 months agoFrederica
18 days agoEdgar
19 days agoCruz
20 days agoSkye
21 days agoYasuko
24 days agoGarry
1 months agoEdna
1 months agoAja
2 months agoChaya
2 months agoAja
2 months agoMarla
2 months agoGretchen
2 months agoAntonette
24 days agoErick
25 days agoJerrod
26 days agoTawna
29 days agoErick
2 months agoWilburn
2 months agoMerlyn
2 months agoMalika
2 months agoIlene
1 months agoKarl
1 months agoGerald
1 months agoVenita
2 months ago