compose: CTRL-C does not end compose logs -f
CTRL-C does not end compose logs -f
This started with compose 2.1.0
Steps to reproduce the issue:
- docker-compose logs -f containername
- CTRL-C
whereas docker logs -f containername works as expected
Describe the results you received: Command can only be killed
Describe the results you expected: Return to shell
Additional information you deem important (e.g. issue happens only occasionally):
Output of docker compose version
:
Docker Compose version 2.1.0
Output of docker info
:
Client:
Context: default
Debug Mode: false
Plugins:
buildx: Build with BuildKit (Docker Inc., v0.6.0)
compose: Docker Compose (Docker Inc., 2.1.0)
Server:
Containers: 5
Running: 5
Paused: 0
Stopped: 0
Images: 18
Server Version: 20.10.10
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: 5b46e404f6b9f661a205e28d59c982d3634148f8
runc version: v1.0.2-0-g52b36a2
init version: de40ad0
Security Options:
apparmor
seccomp
Profile: default
cgroupns
Kernel Version: 5.10.0-9-amd64
Operating System: Debian GNU/Linux 11 (bullseye)
OSType: linux
Architecture: x86_64
CPUs: 2
Total Memory: 1.936GiB
Name: debian
ID: FJ7Z:235F:BJJA:OYFZ:6SRB:6XWR:U3JO:SCBH:EQ4G:G55K:2KQL:5JK2
Docker Root Dir: /var/lib/docker
Debug Mode: false
Registry: https://index.docker.io/v1/
Labels:
Experimental: true
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Default Address Pools:
Base: 172.16.0.0/16, Size: 24
Additional environment details:
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 19
- Comments: 23
On Arch Linux “docker-compose logs -f” cannot be exited with multiple CTRL-C but “docker compose logs -f” can be exited with three CTRL-C.
Thanks for the fix, this bug was driving me insane. Any ETA on when this will be released?
ouch, this is a regression - seems to me I’ve fixed this at least twice in the past 😛
This has been fixed in 2.14.2, see https://github.com/docker/compose/pull/10104
I’m seeing this same bug (i.e. after starting containers using
docker compose up -d
and viewing logs withdocker logs -f <container_name>
, I need 3 Ctrl-C keypresses to quit viewing the logs, and this results in an orphaned “docker-compose” process).Still experiencing this…
Same issue here on both Docker Desktop (Mac M1) and Docker installed on Ubuntu 20.04.3 LTS. (VM)
ctrl+c
doesn’t stop logs$ docker version
$ docker-compose version
Docker Compose version v2.1.1
Not sure if this is related, but I just started seeing this problem when trying to exit a regular
docker-compose up
.I have the same issues with docker logs -f … (without the compose).
BUT! com.docker.cli works with a Ctrl-C.
BUT! What about Ctrl-Z ? When I do a docker logs -f … it kind of works with a Ctrl-C, but when I try to do a Ctrl-Z before, any Ctrl-C after that will fail.
cmd.docker.cli is an improvement over this, but still, I would like to use full job control, with Ctrl-Z backgrounding the process. WTF is going on here?
I wouldn’t mind having to press CTRL^C multiple times for the time being, what bothers me the most is the stale process that is left behind as described in https://github.com/docker/compose/issues/8749. At the moment compose logs is simply unusable without some kind of shell wrapper that ensures the process termination, eg: