github.com/skanehira/moby@v17.12.1-ce-rc2+incompatible/daemon/archive_tarcopyoptions_unix.go (about) 1 // +build !windows 2 3 package daemon 4 5 import ( 6 "github.com/docker/docker/container" 7 "github.com/docker/docker/pkg/archive" 8 "github.com/docker/docker/pkg/idtools" 9 ) 10 11 func (daemon *Daemon) tarCopyOptions(container *container.Container, noOverwriteDirNonDir bool) (*archive.TarOptions, error) { 12 if container.Config.User == "" { 13 return daemon.defaultTarCopyOptions(noOverwriteDirNonDir), nil 14 } 15 16 user, err := idtools.LookupUser(container.Config.User) 17 if err != nil { 18 return nil, err 19 } 20 21 return &archive.TarOptions{ 22 NoOverwriteDirNonDir: noOverwriteDirNonDir, 23 ChownOpts: &idtools.IDPair{UID: user.Uid, GID: user.Gid}, 24 }, nil 25 }