Merge pull request #14120 from mdavranche/tempDir
tempDir (in the root dir), must be created after the root dir. Upstream-commit: 2d15b35f7afaf496ecfbfd61e2c102033255386e Component: engine
This commit is contained in:
@ -609,17 +609,6 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||
// set up SIGUSR1 handler to dump Go routine stacks
|
||||
setupSigusr1Trap()
|
||||
|
||||
// set up the tmpDir to use a canonical path
|
||||
tmp, err := tempDir(config.Root)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
|
||||
}
|
||||
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
|
||||
}
|
||||
os.Setenv("TMPDIR", realTmp)
|
||||
|
||||
// get the canonical path to the Docker root directory
|
||||
var realRoot string
|
||||
if _, err := os.Stat(config.Root); err != nil && os.IsNotExist(err) {
|
||||
@ -636,6 +625,17 @@ func NewDaemon(config *Config, registryService *registry.Service) (daemon *Daemo
|
||||
return nil, err
|
||||
}
|
||||
|
||||
// set up the tmpDir to use a canonical path
|
||||
tmp, err := tempDir(config.Root)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to get the TempDir under %s: %s", config.Root, err)
|
||||
}
|
||||
realTmp, err := fileutils.ReadSymlinkedDirectory(tmp)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
|
||||
}
|
||||
os.Setenv("TMPDIR", realTmp)
|
||||
|
||||
// Set the default driver
|
||||
graphdriver.DefaultDriver = config.GraphDriver
|
||||
|
||||
|
||||
Reference in New Issue
Block a user