mirror of
				https://github.com/moby/moby.git
				synced 2022-11-09 12:21:53 -05:00 
			
		
		
		
	Merge pull request #35077 from ryansimmen/35076-WindowsDaemonTmpDir
Windows Daemon should respect DOCKER_TMPDIR
This commit is contained in:
		
						commit
						ab0eb8fcf6
					
				
					 1 changed files with 11 additions and 1 deletions
				
			
		| 
						 | 
				
			
			@ -555,7 +555,17 @@ func NewDaemon(config *config.Config, registryService registry.Service, containe
 | 
			
		|||
	if err != nil {
 | 
			
		||||
		return nil, fmt.Errorf("Unable to get the full path to the TempDir (%s): %s", tmp, err)
 | 
			
		||||
	}
 | 
			
		||||
	os.Setenv("TMPDIR", realTmp)
 | 
			
		||||
	if runtime.GOOS == "windows" {
 | 
			
		||||
		if _, err := os.Stat(realTmp); err != nil && os.IsNotExist(err) {
 | 
			
		||||
			if err := system.MkdirAll(realTmp, 0700, ""); err != nil {
 | 
			
		||||
				return nil, fmt.Errorf("Unable to create the TempDir (%s): %s", realTmp, err)
 | 
			
		||||
			}
 | 
			
		||||
		}
 | 
			
		||||
		os.Setenv("TEMP", realTmp)
 | 
			
		||||
		os.Setenv("TMP", realTmp)
 | 
			
		||||
	} else {
 | 
			
		||||
		os.Setenv("TMPDIR", realTmp)
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	d := &Daemon{
 | 
			
		||||
		configStore: config,
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue