(TIL) Docker: Attach/Detach

less than 1 minute read

To detach from a container, you hold Ctrl and press P, then Q. This only works if the container was started with both -t and -i.

If this doesn’t work for some reason, try:

docker stop <containerid>

To attach to a running container you use:

docker container attach "container_name"

Via SO.