for-mac icon indicating copy to clipboard operation
for-mac copied to clipboard

Resource saver mode causing unnecessary docker compose rebuilds

Open philo23 opened this issue 9 months ago • 1 comments

Description

I've noticed since around 2 months ago that Docker Desktop doesn't seem to wake up quickly enough from Resource Saver mode to stop itself from trying to rebuild container images that actually already exist when running through docker compose.

It's almost like as if it can't see the pre-built images right after waking up, so it just assumes they don't exist and starts building them. Cancelling the rebuild and trying again starts the containers immediately.

Reproduce

  1. Open Docker Desktop UI, ensure you're already signed in and there's currently no containers running
  2. Run docker compose up in a project to start some containers using images that have already been built, so they start without the build step.
  3. Run docker compose down in the same project, so all containers are removed leaving no containers running.
  4. Wait for Resource Saver mode to kick in (you can configure it down to the minimum to reproduce it quicker)
  5. Run docker compose up again in the same project, watch docker attempt to pull/build the containers again, kill process.
  6. re-run docker compose up in the same project and watch docker just start the same containers as in step 2 without rebuilding the images.

I'm able to reproduce this problem every time I've tried.

Also I've noticed the "You're not signed in as [email protected]" notification pops up in the bottom right of the Docker Desktop UI every time I reopen the UI after it's gone into Resource Saver mode. It might just be a red herring but it never used to do this and only started doing this after this bug started happening.

Expected behavior

Running docker compose up while Resource Saver mode is active, in a project with images already built, should start the containers instantly without having to open up the Docker Desktop UI to wake up from Resource Saver mode first.

Just like when Docker Desktop is running while Resource Saver mode isn't active.

docker version

Client:
 Version:           28.0.1
 API version:       1.48
 Go version:        go1.23.6
 Git commit:        068a01e
 Built:             Wed Feb 26 10:38:16 2025
 OS/Arch:           darwin/arm64
 Context:           desktop-linux

Server: Docker Desktop 4.39.0 (184744)
 Engine:
  Version:          28.0.1
  API version:      1.48 (minimum version 1.24)
  Go version:       go1.23.6
  Git commit:       bbd0a17
  Built:            Wed Feb 26 10:40:57 2025
  OS/Arch:          linux/arm64
  Experimental:     false
 containerd:
  Version:          1.7.25
  GitCommit:        bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc:
  Version:          1.2.4
  GitCommit:        v1.2.4-0-g6c52b3f
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    28.0.1
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  ai: Docker AI Agent - Ask Gordon (Docker Inc.)
    Version:  v0.9.4
    Path:     /Users/me/.docker/cli-plugins/docker-ai
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.21.1-desktop.2
    Path:     /Users/me/.docker/cli-plugins/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.33.1-desktop.1
    Path:     /Users/me/.docker/cli-plugins/docker-compose
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.38
    Path:     /Users/me/.docker/cli-plugins/docker-debug
  desktop: Docker Desktop commands (Beta) (Docker Inc.)
    Version:  v0.1.5
    Path:     /Users/me/.docker/cli-plugins/docker-desktop
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     /Users/me/.docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.27
    Path:     /Users/me/.docker/cli-plugins/docker-extension
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     /Users/me/.docker/cli-plugins/docker-feedback
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.4.0
    Path:     /Users/me/.docker/cli-plugins/docker-init
  sbom: View the packaged-based Software Bill Of Materials (SBOM) for an image (Anchore Inc.)
    Version:  0.6.0
    Path:     /Users/me/.docker/cli-plugins/docker-sbom
  scout: Docker Scout (Docker Inc.)
    Version:  v1.16.3
    Path:     /Users/me/.docker/cli-plugins/docker-scout

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 66
 Server Version: 28.0.1
 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: 2
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local splunk syslog
 CDI spec directories:
  /etc/cdi
  /var/run/cdi
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: bcc810d6b9066471b0b6fa75f557a15a1cbf31bb
 runc version: v1.2.4-0-g6c52b3f
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.10.14-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: aarch64
 CPUs: 10
 Total Memory: 7.654GiB
 Name: docker-desktop
 ID: 342969ed-8553-4c77-a541-98fc2934a801
 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
 Labels:
  com.docker.desktop.address=unix:///Users/me/Library/Containers/com.docker.docker/Data/docker-cli.sock
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  ::1/128
  127.0.0.0/8
 Live Restore Enabled: false

Diagnostics ID

A7123795-0351-43EC-9646-2F7C6B5B41BA/20250313165207

Additional Info

In case its important, I'm using fish shell with the latest shell completions setup (as prompted by the UI)

I've also attached a copy of the output of running docker compose up with the incorrect build step

docker-compose-output.txt

philo23 avatar Mar 13 '25 17:03 philo23

Same on Win 10.

datbunneh avatar Mar 28 '25 08:03 datbunneh

+1 also seeing this issue. I've ended up just disabling resource saver as there also doesn't seem to be a good way to bring docker desktop out of this state other than starting a container.

matt-sanders avatar Jun 24 '25 20:06 matt-sanders