docker / desktop-linux

Bug reports for Docker Desktop for Linux
https://docs.docker.com/desktop/linux/
73 stars 5 forks source link

quitting docker desktop also closes all the terminals #184

Open nicks opened 5 months ago

nicks commented 5 months ago

Description

When I quit docker desktop (whale menu -> Quit Docker Desktop), all my terminals close.

Reproduce

see above

Expected behavior

my terminals should stay open

docker version

Client: Docker Engine - Community
 Cloud integration: v1.0.35+desktop.5
 Version:           24.0.7
 API version:       1.43
 Go version:        go1.20.10
 Git commit:        afdd53b
 Built:             Thu Oct 26 09:07:41 2023
 OS/Arch:           linux/amd64
 Context:           desktop-linux

Server: Docker Desktop 4.26.0 (128892)
 Engine:
  Version:          24.0.7
  API version:      1.43 (minimum version 1.12)
  Go version:       go1.20.10
  Git commit:       311b9ff
  Built:            Thu Oct 26 09:08:17 2023
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.6.24
  GitCommit:        61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
 runc:
  Version:          1.1.9
  GitCommit:        v1.1.9-0-gccaecfc
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0

docker info

Client: Docker Engine - Community
 Version:    24.0.7
 Context:    desktop-linux
 Debug Mode: false
 Plugins:
  buildx: Docker Buildx (Docker Inc.)
    Version:  v0.11.2-desktop.5
    Path:     /home/nick/.pinata/downloads/docker-plugins/v0.11.2-desktop.5/docker-buildx
  compose: Docker Compose (Docker Inc.)
    Version:  v2.23.1-desktop.1
    Path:     /usr/lib/docker/cli-plugins/docker-compose
  dev: Docker Dev Environments (Docker Inc.)
    Version:  v0.1.0
    Path:     /usr/lib/docker/cli-plugins/docker-dev
  extension: Manages Docker extensions (Docker Inc.)
    Version:  v0.2.20
    Path:     /usr/lib/docker/cli-plugins/docker-extension
  harmonia: Extend your localhost with cloud workspaces (Docker Inc.)
    Version:  0.7.58-m
    Path:     /home/nick/.docker/cli-plugins/docker-harmonia
  hi: Silly bash command that echos hi (Docker Inc.)
    Version:  0.1.0
    Path:     /home/nick/.docker/cli-plugins/docker-hi
  init: Creates Docker-related starter files for your project (Docker Inc.)
    Version:  v0.1.0-beta.9
    Path:     /usr/lib/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:     /usr/lib/docker/cli-plugins/docker-sbom
  scan: Docker Scan (Docker Inc.)
    Version:  v0.26.0
    Path:     /usr/lib/docker/cli-plugins/docker-scan
  scout: Docker Scout (Docker Inc.)
    Version:  v1.0.9
    Path:     /usr/lib/docker/cli-plugins/docker-scout
  sleep:  (Docker Inc.)
    Version:  0.1.0
    Path:     /home/nick/.docker/cli-plugins/docker-sleep

Server:
 Containers: 0
  Running: 0
  Paused: 0
  Stopped: 0
 Images: 0
 Server Version: 24.0.7
 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 logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 61f9fd88f79f081d64d6fa3bb1a0dc71ec870523
 runc version: v1.1.9-0-gccaecfc
 init version: de40ad0
 Security Options:
  seccomp
   Profile: unconfined
  cgroupns
 Kernel Version: 6.5.11-linuxkit
 Operating System: Docker Desktop
 OSType: linux
 Architecture: x86_64
 CPUs: 8
 Total Memory: 3.645GiB
 Name: docker-desktop
 ID: 12a6a00e-8542-4200-96fd-8bd525ff9d6c
 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

WARNING: daemon is not using the default seccomp profile

Diagnostics ID

n/a

Additional Info

I'm pretty sure the bug is the systemd unit file:

[Unit]
Description=Docker Desktop
Requires=graphical-session.target
After=graphical-session.target

[Service]
ExecStart=/opt/docker-desktop/bin/com.docker.backend
Type=exec
TimeoutSec=60

[Install]
Alias=docker-desktop.service
WantedBy=graphical-session.target

If I run com.docker.backend manually, the problem goes away. The problem only happens when I run Docker Desktop through systemd.

I'm pretty sure the usage of Requires=graphical-session.target is wrong here, for two reasons:

systemctl --user status graphical-session.target 
○ graphical-session.target - Current graphical user session
     Loaded: loaded (/usr/lib/systemd/user/graphical-session.target; static)
     Active: inactive (dead)
       Docs: man:systemd.special(7)

Jan 02 10:01:59 grumpy systemd[2002]: Reached target Current graphical user session.
Jan 02 10:06:12 grumpy systemd[2002]: Stopped target Current graphical user session

even when i have a graphical session

rmunn commented 1 month ago

Probably a duplicate of #109. Try starting gnome-terminal-server first (found in /usr/libexec/gnome-terminal-server), and then start Docker Desktop. If this is the same bug as #109, that's a workaround that should ensure Docker Desktop doesn't close terminal windows it didn't open. See https://github.com/docker/desktop-linux/issues/109#issuecomment-1544438060 for more.

sixty-nine commented 1 week ago

Still happening on ubuntu.

When manually running gnome-terminal-server, then docker-desktop won't start at all:

image

Would be great to fix your app so that it does not closes other apps, this behavior is super rude, and... why?!!....