gpt4 book ai didi

docker - 来源:守护进程在createContainer中调用libcontainer的位置

转载 作者:行者123 更新时间:2023-12-02 20:19:02 26 4
gpt4 key购买 nike

我发现守护程序通过这些代码创建了一个容器

// NewBaseContainer creates a new container with its
// basic configuration.
func NewBaseContainer(id, root string) *Container {
return &Container{
CommonContainer: CommonContainer{
ID: id,
State: NewState(),
ExecCommands: exec.NewStore(),
Root: root,
MountPoints: make(map[string]*volume.MountPoint),
StreamConfig: runconfig.NewStreamConfig(),
attachContext: &attachContext{},
},
}
}

看起来就像创建一个实例,只是一些配置。我不知道它在哪里调用libcontainer创建真实的容器。

最佳答案

该代码实际上来自 container/container.go
您必须回到docker 1.9.0才能找到实际上仍在 daemon/daemon_windows.go 中的代码

一个新的守护进程is setup with a libcontainerd,以创建实际的容器(在docker 1.10或更高版本中)

关于docker - 来源:守护进程在createContainer中调用libcontainer的位置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40327194/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com