docker - 源码相关:daemon创建容器时是从哪里调用更底层的libcontainer创建容器的?

 小色米虫_524 发布于 2022-10-25 17:11

在看Create这个步骤,从Cli到Client到Daemon一点点看下来
找到这么个方法

// 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{},
        },
    }
}

感觉确实是创建了一个实例出来,但是没找到更底层的调用,是我找错地方了么?但是后面就是在对已经创建出的容器来做操作了。

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有