mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #14120 from mdavranche/tempDir
tempDir (in the root dir), must be created after the root dir.
This commit is contained in:
commit
2d15b35f7a
1 changed files with 11 additions and 11 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue