docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.85k stars 283 forks source link

Lots of `.tmp.ico` files created everyday in `$HOME/AppData/Local/Temp/` #13826

Open olfek opened 7 months ago

olfek commented 7 months ago

Description

Run the following command to see all the .tmp.ico files.

(Powershell)

dir "$HOME/AppData/Local/Temp/*.tmp.ico" | sort "LastWriteTime" -Descending

Reproduce

Run Docker Desktop everyday.

Expected behavior

Only a few .tmp.ico files?

docker version

Client:
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.6
 API version:       1.43
 Go version:        go1.20.7
 Git commit:        ed223bc
 Built:             Mon Sep  4 12:32:48 2023
 OS/Arch:           windows/amd64
 Context:           default

Server: Docker Desktop 4.25.2 (129061)
 Engine:
  Version:          24.0.6
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.7
  Git commit:       1a79695
  Built:            Mon Sep  4 12:32:16 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.22
  GitCommit:        8165feabfdfe38c65b599c4993d227328c231fca
 runc:
  Version:          1.1.8
  GitCommit:        v1.1.8-0-g82f18fe
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    24.0.6
 Context:    default
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.0-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     C:\Program Files\Docker\cli-plugins\docker-init.exe
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-sbom.exe
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     C:\Program Files\Docker\cli-plugins\docker-scan.exe
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 3
  Running: 0
  Paused: 0
  Stopped: 3
 Images: 2
 Server Version: 24.0.6
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Using metacopy: false
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 8165feabfdfe38c65b599c4993d227328c231fca
 runc version: v1.1.8-0-g82f18fe
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.133.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 16
 Total Memory: 5.789GiB
 Name: [REDACTED]
 ID: ccea4122-a4e6-4147-b224-c811e65e6740
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 HTTP Proxy: http.docker.internal:3128
 HTTPS Proxy: http.docker.internal:3128
 No Proxy: hubproxy.docker.internal
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

Diagnostics ID

-

Additional Info

docker-icos.txt

hhromic commented 7 months ago

I can confirm this as well for me on Docker Desktop 4.16.0 in Windows 10.

All I have to do to easily reproduce is to stop Docker Desktop, clean all *.ico files in %LOCALAPPDATA%\Temp and then restart Docker Desktop again. You will see a fresh set of *.ico files as mentioned in this issue:

Mode                 LastWriteTime         Length Name
----                 -------------         ------ ----
-a----        12/10/2023   9:23 PM         362870 01fce4c6-e797-4f7d-91b9-cd86e4f803af.tmp.ico
-a----        12/10/2023   9:23 PM         285478 1f4658dd-bb58-4e65-8f98-bc346393435a.tmp.ico
-a----        12/10/2023   9:23 PM         285478 21c53438-0fcc-452a-877a-098f97e1ad64.tmp.ico
-a----        12/10/2023   9:23 PM         362870 2addf3cc-9973-4b24-b641-898389fc36ea.tmp.ico
-a----        12/10/2023   9:23 PM         362870 2fa1c4c6-6987-450f-a6a9-cd4a3f47d8e4.tmp.ico
-a----        12/10/2023   9:23 PM         102395 304404d3-d789-4858-9281-629a0fd84e7f.tmp.ico
-a----        12/10/2023   9:23 PM         362870 3c84c6d8-a48f-402a-b24c-74e625a4b12b.tmp.ico
-a----        12/10/2023   9:23 PM         285478 3e278b10-1d82-4bf0-bd28-e5fa0684327a.tmp.ico
-a----        12/10/2023   9:23 PM         103203 406d2d8e-e8b3-4ecb-8e01-486b69056fea.tmp.ico
-a----        12/10/2023   9:23 PM         102201 4be151a2-4315-447b-b955-3420d6718d26.tmp.ico
-a----        12/10/2023   9:23 PM         362870 57c302cb-8b88-47ae-85c9-5c4c82fc3da4.tmp.ico
-a----        12/10/2023   9:23 PM         362870 5b86f4f5-2515-4a9a-ad4c-64da72f1096a.tmp.ico
-a----        12/10/2023   9:23 PM         102217 6ab54c75-fc3a-4168-89fb-fde8d8127341.tmp.ico
-a----        12/10/2023   9:23 PM         102527 6ee6b35e-7549-48e3-858e-4e60c84ecbf8.tmp.ico
-a----        12/10/2023   9:23 PM         102242 958b176b-841a-4225-87e2-fcbadbeb2ecf.tmp.ico
-a----        12/10/2023   9:23 PM         102050 9820f0bc-8a11-4ad8-abc8-f559ccbc85c2.tmp.ico
-a----        12/10/2023   9:23 PM         362870 9f54793c-5c74-491d-bb66-2b915770ae3e.tmp.ico
-a----        12/10/2023   9:23 PM         102099 a13acc9f-d67f-41e0-88e7-d19391a8b3d5.tmp.ico
-a----        12/10/2023   9:23 PM         102330 a5b6094c-ee1d-4eda-8132-cf5a8d1fc2aa.tmp.ico
-a----        12/10/2023   9:23 PM         285478 ae6aa2d8-40d2-45ce-acaa-a2234aea5b27.tmp.ico
-a----        12/10/2023   9:23 PM         102181 bd4c49e9-4e41-4756-b3df-9b3651163f00.tmp.ico
-a----        12/10/2023   9:23 PM         362870 bdc339b3-4b3b-4992-a969-814ec24c8595.tmp.ico
-a----        12/10/2023   9:23 PM         102271 c3f2cf3c-65b6-4ea0-a631-e3d29d3fe5d0.tmp.ico
-a----        12/10/2023   9:23 PM         362870 cad8a1f9-7684-4cbd-a385-8b8c52374080.tmp.ico
-a----        12/10/2023   9:23 PM         102243 cc1ce8d2-e688-4a24-9bbf-8c86f2b29614.tmp.ico
-a----        12/10/2023   9:23 PM         362870 d029fbd4-e180-452a-8231-582e1bfc9739.tmp.ico
-a----        12/10/2023   9:23 PM         362870 dd3f6269-9be2-4721-b346-8562cc75c484.tmp.ico
-a----        12/10/2023   9:23 PM         362870 e5392568-59cb-4f28-b55f-dde8aa1fd42d.tmp.ico
-a----        12/10/2023   9:23 PM         102437 eb1bb971-cd54-4cec-ac6f-b593d147985d.tmp.ico
-a----        12/10/2023   9:23 PM         103398 f881574b-d861-4717-9d66-e8f00bc91aef.tmp.ico

These files are not cleaned automatically and therefore start piling up in time.

I took a quick look and these icons seem to be used for the Taskbar icon of Docker Desktop.

olfek commented 7 months ago

@bsousaa are any of those labels high priority? because something like this can increase SSD wear and tear.

thrandale commented 5 months ago

I checked this today on my computer, and I had over 30GB of docker .ico files. After only having been running docker for a few months. It is unacceptable to not be cleaning up all these temp files.

thaJeztah commented 5 months ago

I checked this today on my computer, and I had over 30GB of docker .ico files. After only having been running docker for a few months. It is unacceptable to not be cleaning up all these temp files.

Yikes! That's a lot.

I forgot to post here, but I asked internally among colleagues Yesterday (I'm not on the Docker Desktop team, but noticed your comment, and was curious!).

A colleague pointed me to this ticket in the electron issue tracker;

And their (electron maintainers) conclusion was that this was "expected behavior", as they assume the operating system to be responsible for cleaning this up

Because these files are created in Temp they can (and will) be cleaned by the OS whenever it wants to. Them being left behind is ok as the OS will clean this folder up.

I can partially related to that, but (personally! again, not on the team maintaining that part of the code 🙈) agree it's somewhat unexpected for that amount of data to accumulate in a temp-directory.

As cleaning-up the Temp directory as a whole would be out of scope for Docker Desktop (it's the system's configured Temp-directory, so not "owned" by Docker Desktop), an alternative could be to look if electron could be configured to use sub-directory for this (such a directory would be "owned" by Docker Desktop, so could also be cleaned up without stepping on other software's toes).

I'm not familiar with electron myself though, so asked that question in our internal chat; it's weekend now, so more to come probably after the weekend (LOL, I shouldn't be replying here during the weekend 🙈)

olfek commented 5 months ago

@thaJeztah ...

I think the question "who should clean the .ico files and when" is the wrong question, the right question is "why are so many identical .ico files created in the first place?" - Their only difference is the file name, they are all the same graphic!

thaJeztah commented 5 months ago

🤷My guess? Based on the name using a GUID, I guess the electron maintainers used unique names to prevent concurrency issues (multiple instances of an electron app stepping on each others toes), and fun things like file locking or file corruption because of that.

T1ckbase commented 2 months ago

Can I turn off the tray icon to prevent these .tmp.ico files from being generated?