Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't exit from docker-compose logs -f [container name]

I can successfully follow the logs of a container by entering docker-compose -f [containerName] (where containerName is the name of the docker container I want to follow. Once I'm following the logs, though, I'm unable to exit by pressing control + c, control + z , q, bye or any of the normal exit commands. The log just continues

like image 469
Jolley71717 Avatar asked Feb 13 '19 23:02

Jolley71717


People also ask

How do I come out of docker compose?

Starting and Stopping Docker Compose You can stop it using CTRL+C (run once for the preferable graceful shutdown, or twice to force-kill).

How do I get out of a docker container without exiting it?

if you want to detach from container without exiting(without killing the bash shell), By default , you can use ctrl-p,q . it will come out of container without exiting from the container(running background.

How do I stop running after docker?

To stop one or more running Docker containers, you can use the docker stop command. The syntax is simple: $ docker stop [OPTIONS] CONTAINER [CONTAINER...] You can specify one or more containers to stop.


2 Answers

Ctrl+\ sends SIGQUIT, which prints out debug information and ends the process.

like image 148
XMB5 Avatar answered Sep 20 '22 07:09

XMB5


Press Ctrl+C two or three times, which will usually stop the logging process with:

ERRO[0004] got 3 SIGTERM/SIGINTs, forcing shutdown

As of November 2021, there is still a docker-compose bug that prevents closing the logs when using the --follow (-f) flag with a single Ctrl+C.

See GitHub project issue: CTRL-C does not end compose logs -f #8880

like image 37
Christopher Peisert Avatar answered Sep 21 '22 07:09

Christopher Peisert