Skip to content

DOCKER_TMPDIR no longer respected on Windows since v25 (go1.21 and up) #48093

@juzsal

Description

@juzsal

Description

When using Docker v24 on Windows Server 2022, setting DOCKER_TMPDIR successfully causes Docker to write temporary data to the configured tempdir, e.g. when pulling images.

Since v25, this appears to have stopped working, and all temp data is being incorrectly written to C:\Windows\SystemTemp.

Reproduce

  1. On Windows Server 2022 with a secondary drive e.g. D:, configure v26 daemon with "data-root": "D:\\docker"
  2. Set DOCKER_TMPDIR=D:\tmp system-wide
  3. docker pull mcr.microsoft.com/windows/server:ltsc2022
  4. dir C:\Windows\SystemTemp\
  5. Observe temporary files (e.g. GetImageBlob1051740717) being created

Expected behavior

Temporary files should be created in D:\temp, not in C:\Windows\SystemTemp

docker version

Client:
 Version:           26.1.0
 API version:       1.45
 Go version:        go1.21.9
 Git commit:        9714adc
 Built:             Mon Apr 22 17:07:39 2024
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Engine - Community
 Engine:
  Version:          26.1.0
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.9
  Git commit:       c8af8eb
  Built:            Mon Apr 22 17:06:23 2024
  OS/Arch:          windows/amd64
  Experimental:     false

docker info

Client:
 Version:    26.1.0
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.15.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 2
 Server Version: 26.1.0
 Storage Driver: windowsfilter
  Windows:
 Logging Driver: json-file
 Plugins:
  Volume: local
  Network: ics internal l2bridge l2tunnel nat null overlay private transparent
  Log: awslogs etwlogs fluentd gcplogs gelf json-file local splunk syslog
 Swarm: inactive
 Default Isolation: process
 Kernel Version: 10.0 20348 (20348.1.amd64fre.fe_release.210507-1500)
 Operating System: Microsoft Windows Server Version 21H2 (OS Build 20348.2527)
 OSType: windows
 Architecture: x86_64
 CPUs: 16
 Total Memory: 30.98GiB
 Name: wc54xlrg1
 ID: 9ba3342f-6a6b-4576-9c6a-4cec42c342b8
 Docker Root Dir: D:\docker
 Debug Mode: false
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false
 Product License: Community Engine

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions