compose icon indicating copy to clipboard operation
compose copied to clipboard

docker compose V2.6.0 on Ubuntu 22.04: CTRL-C don't stop the container

Open juewach opened this issue 3 years ago • 1 comments

Send CTRL-C to stop Container doens't work

Start container with "docker containers in the foreground and try to to stop the runing containers with CTRL-C in my terminal (bash). This shouldn't working. I have to send a second CTL-C then killing the container, but doesn't returining to the command line. After sending the third CTRL-C i go back to the command line.

docker version: 20.10.17, build 100c701 docker compose version: v2.6.0 Ubuntu 22.04 LTS jammy

root@nextcloud /data/nextcloud # docker info Client: Context: default Debug Mode: false Plugins: app: Docker App (Docker Inc., v0.9.1-beta3) buildx: Docker Buildx (Docker Inc., v0.8.2-docker) compose: Docker Compose (Docker Inc., v2.6.0) scan: Docker Scan (Docker Inc., v0.17.0)

Server: Containers: 4 Running: 0 Paused: 0 Stopped: 4 Images: 8 Server Version: 20.10.17 Storage Driver: overlay2 Backing Filesystem: extfs Supports d_type: true Native Overlay Diff: true userxattr: false Logging Driver: json-file Cgroup Driver: systemd 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 io.containerd.runtime.v1.linux runc Default Runtime: runc Init Binary: docker-init containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1 runc version: v1.1.2-0-ga916309 init version: de40ad0 Security Options: apparmor seccomp Profile: default cgroupns Kernel Version: 5.15.0-43-generic Operating System: Ubuntu 22.04 LTS OSType: linux Architecture: x86_64 CPUs: 16 Total Memory: 62.73GiB Name: nextcloud.hdkn.eu ID: TFCM:JF6J:QHGX:J55U:6X6W:VTNU:U5UW:ECKK:NPO7:CELO:FWUP:C4ZL Docker Root Dir: /var/lib/docker Debug Mode: false Registry: https://index.docker.io/v1/ Labels: Experimental: false Insecure Registries: 127.0.0.0/8 Live Restore Enabled: false

root@nextcloud /data/nextcloud #

Thanks Juergen

juewach avatar Aug 09 '22 09:08 juewach

Hello @juewach Most of the time this is an issue with the underlying technology used inside the container which doesn't handle correctly exit signals, can you try to change the stop_signal like this in your compose file and see if it fixes your issue? If not can you provide us more details about your stack?

glours avatar Aug 09 '22 09:08 glours