官术网_书友最值得收藏!

Namespaces

The other part of the container puzzle is kernel namespaces. They operate in a manner that is somewhat similar to our use of the chroot syscall in that a container engine instructs the kernel to only allow the process a particular view of the system's resources.

Instead of just limiting access to the filesystem kernel, namespaces limit access to a number of different resources.

Each process can be assigned to a namespace and can then only see the resources connected to that namespace. The kinds of resources that can be namespaced are as follows:

  • Mount: Mount namespaces control access to the filesystem.
  • Users: Each namespace has its own set of user IDs. User ID namespaces are nested, and thus a user in a higher-level namespace can be mapped to another in a lower level. This is what allows a container to run processes as root, without giving that process full permission to the root system.
  • PID: The process ID namespace, like the users namespace, is nested. This is why the host can see the processes running inside of the containers when inspecting the process list on a system that is running containers. However, inside of the namespace the numbers are different; this means that the first process created inside a PID namespace, can be assigned PID 1, and can inherit zombie processes if required.
  • Network: A network namespace contains one or more network interfaces. The namespace has its own private network resources, such as addresses, the routing table, and firewall.
There are also namespaces for IPC, UTS, and for the Cgroups interface itself.
主站蜘蛛池模板: 任丘市| 鹤壁市| 绥化市| 宁都县| 定兴县| 天长市| 永仁县| 长子县| 乐安县| 泸西县| 阿勒泰市| 高青县| 和平县| 英山县| 潮州市| 增城市| 沂源县| 新乡县| 云和县| 南投县| 天峻县| 綦江县| 来宾市| 上杭县| 鹤岗市| 元朗区| 遂宁市| 仪陇县| 阿荣旗| 荔波县| 峡江县| 左云县| 曲水县| 高淳县| 凤城市| 汉寿县| 体育| 灵川县| 道真| 新巴尔虎右旗| 南皮县|