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

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.
主站蜘蛛池模板: 治县。| 类乌齐县| 绍兴市| 安新县| 商丘市| 南城县| 西畴县| 临清市| 临沭县| 德清县| 溧阳市| 乌兰察布市| 阜城县| 白玉县| 永年县| 平乐县| 成安县| 长寿区| 拜城县| 尉氏县| 海原县| 昆山市| 绩溪县| 三亚市| 昌平区| 芦溪县| 丹江口市| 英吉沙县| 苍南县| 松溪县| 察雅县| 灵武市| 科技| 沁水县| 隆林| 大理市| 凤庆县| 来宾市| 遂平县| 万年县| 蓬莱市|