github.com/afbjorklund/moby@v20.10.5+incompatible/daemon/workdir.go (about) 1 package daemon // import "github.com/docker/docker/daemon" 2 3 // ContainerCreateWorkdir creates the working directory. This solves the 4 // issue arising from https://github.com/docker/docker/issues/27545, 5 // which was initially fixed by https://github.com/docker/docker/pull/27884. But that fix 6 // was too expensive in terms of performance on Windows. Instead, 7 // https://github.com/docker/docker/pull/28514 introduces this new functionality 8 // where the builder calls into the backend here to create the working directory. 9 func (daemon *Daemon) ContainerCreateWorkdir(cID string) error { 10 container, err := daemon.GetContainer(cID) 11 if err != nil { 12 return err 13 } 14 err = daemon.Mount(container) 15 if err != nil { 16 return err 17 } 18 defer daemon.Unmount(container) 19 return container.SetupWorkingDirectory(daemon.idMapping.RootPair()) 20 }