Docker和Host之间的进程任务结构

标签 process docker

docker 和主机进程中的进程任务结构有何不同,除了主机之外,docker 中的任何特定模块有何不同?

最佳答案

由于处理在内核中由名为“task_struct”的结构表示,因此该结构在容器中是相同的。

容器基于 system calls 到主机内核,任何与内核相关的结构都直接来自所述内核。

参见“Architecting Containers: Why Understanding User Space vs. Kernel Space Matters

A typical program gets access to resources in the kernel through layers of abstraction similar to the following diagram:

https://rhelblog.files.wordpress.com/2015/07/user-space-vs-kernel-space-system-calls-gears.png?w=300

The kernel provides abstraction for security, hardware, and internal data structures. The open() system call is commonly used to get a file handle

Notice in the following drawing that bash makes a getpid() call which requests its own process identity.
Also, notice that the cat command requests access to /etc/hosts with a file open() call.

https://rhelblog.files.wordpress.com/2015/07/user-space-vs-kernel-space-basic-system-calls.png?w=584&h=219

关于Docker和Host之间的进程任务结构,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33116930/

相关文章:

docker - 将docker images目录从Windows上的C驱动器移出

macos - 无法在 mac 上启动 docker - fatal error - 操作无法完成。 (Docker.VmnetdError 错误 1。)

python-3.x - 无法使用SQLAlchemy连接到MYSQL

docker - 如何将配置文件保存在正在运行的容器中?

node.js - 从未使用redis在child_process.exec中调用回调

java - 使用自动滚动将处理输出流式传输到 Javafx Textarea

C# 并行运行多个非阻塞外部程序

c# - 在C#中发送cmd命令并读取结果

docker - docker运行时如何传递crontab命令

c - 使用来自多个进程的 fseek/fwrite 写入文件的不同区域?