search

Home  >  Q&A  >  body text

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

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

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

PHPzPHPz2774 days ago973

reply all(1)I'll reply

  • 小小卫

    小小卫2017-09-20 17:46:47

    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.

    reply
    0
  • Cancelreply