docker / for-win

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

Docker containers unhealthy after Windows reboot #14131

Open rg9400 opened 2 weeks ago

rg9400 commented 2 weeks ago

Description

This issue has been present for multiple versions, but I realized there was no other issue created. Anytime I restart my Windows host, roughly 10-15 (out of 60) containers of mine end up unhealthy. Some of them are not started at all, and others are started but cannot read the mounted folders. When I do a force recreate, all of them start up again perfectly fine. This was a regression as these containers would start up properly on host restarts earlier, but I am unable to fully identify exactly when the issue began.

Reproduce

I am not sure if there is something very specific to my setup as it occurs for random containers each time, occurs each and every reboot. This makes me think others should have this issue, but I am not seeing any other reports of it. It might be related to the number of containers I use?

  1. Enable Docker Desktop to start when you sign in to the computer
  2. Use the following compose
    openssh:
    image: linuxserver/openssh-server
    container_name: openssh
    environment:
      - PUID=${PUID}
      - PGID=${PGID}
      - UMASK=${UMASK}
      - TZ=${TZ}
    volumes:
      - ${CONFDIR}/openssh:/config
      - ${LOGDIR}/openssh:/config/logs
    ports:
      - 2222:2222
    hostname: ${HOSTNAME}
    logging: *default-logging
    labels: *default-labels
    restart: unless-stopped
  3. Maybe put in a stack of multiple containers
  4. Restart Windows host. Verify this container is running and healthy.
  5. Force recreate this container, validate it is now healthy.

Expected behavior

Containers should start back up smoothly when the host restarts. Otherwise, you need access to the terminal of the host to force recreate all the containers after each restart, which is not idel.

docker version

Client:
 Version:           26.1.4
 API version:       1.45
 Go version:        go1.21.11
 Git commit:        5650f9b
 Built:             Wed Jun  5 11:29:54 2024
 OS/Arch:           windows/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.31.1 (153621)
 Engine:
  Version:          26.1.4
  API version:      1.45 (minimum version 1.24)
  Go version:       go1.21.11
  Git commit:       de5c9cf
  Built:            Wed Jun  5 11:29:22 2024
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.33
  GitCommit:        d2d58213f83a351ca8f528a95fbd145f5654e957
 runc:
  Version:          1.1.12
  GitCommit:        v1.1.12-0-g51d5e94
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client:
 Version:    26.1.4
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.14.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-buildx.exe
  compose: Docker Compose (Docker Inc.)
    Version:  v2.27.1-desktop.1
    Path:     C:\Program Files\Docker\cli-plugins\docker-compose.exe
  debug: Get a shell into any image or container (Docker Inc.)
    Version:  0.0.32
    Path:     C:\Program Files\Docker\cli-plugins\docker-debug.exe
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.2
    Path:     C:\Program Files\Docker\cli-plugins\docker-dev.exe
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.24
    Path:     C:\Program Files\Docker\cli-plugins\docker-extension.exe
  feedback: Provide feedback, right in your terminal! (Docker Inc.)
    Version:  v1.0.5
    Path:     C:\Program Files\Docker\cli-plugins\docker-feedback.exe
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v1.2.0
    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
  scout: Docker Scout (Docker Inc.)
    Version:  v1.9.3
    Path:     C:\Program Files\Docker\cli-plugins\docker-scout.exe

Server:
 Containers: 58
  Running: 58
  Paused: 0
  Stopped: 0
 Images: 55
 Server Version: 26.1.4
 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 splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: d2d58213f83a351ca8f528a95fbd145f5654e957
 runc version: v1.1.12-0-g51d5e94
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
 Kernel Version: 5.15.153.1-microsoft-standard-WSL2
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 32
 Total Memory: 62.74GiB
 Name: docker-desktop
 ID: 5d52e1ec-ab2d-415a-b4c8-88938543c9aa
 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=npipe://\\.\pipe\docker_cli
 Experimental: false
 Insecure Registries:
  hubproxy.docker.internal:5555
  127.0.0.0/8
 Live Restore Enabled: false

WARNING: No blkio throttle.read_bps_device support
WARNING: No blkio throttle.write_bps_device support
WARNING: No blkio throttle.read_iops_device support
WARNING: No blkio throttle.write_iops_device support
WARNING: daemon is not using the default seccomp profile

Diagnostics ID

7E746511-651C-4A74-8C84-91189E8962C1/20240613154557

Additional Info

No response

tscni commented 2 weeks ago

I had possibly similar issues, but I don't particularly remember the details. More importantly, downgrading to Docker Desktop 4.25.2 resolved all of the issues and I've been staying on it ever since. The issues were already present on 4.26.0.