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
Starting and Stopping Docker Compose You can stop it using CTRL+C (run once for the preferable graceful shutdown, or twice to force-kill).
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.
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.
Ctrl+\
sends SIGQUIT
, which prints out debug information and ends the process.
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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With