docker - 源码相关:daemon创建容器时是从哪里调用更底层的libcontainer创建容器的?
PHPz
PHPz 2017-04-25 09:02:18
0
1
983

在看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{},
        },
    }
}

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

PHPz
PHPz

学习是最好的投资!

reply all(1)
小小卫

No more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou, no more Doudou.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template