How to disconnect from a docker container

This problem is very similar to this , but I still have problems:

I start the container with:

docker run -d CONTAINER 

then I attach to it

 docker attach NAME 

but I cannot exit it, not with CTRL-C, nor with CTRL-P + CTRL-Q (as suggested in a similar question above)

I need kill -9 PID to exit it ...

What am I doing wrong?

Information:

Dock version 0.6.7, build cb48ecc
Ubuntu 3.8.0-33-generic # 48 ~ exact1-Ubuntu

+48
docker
Nov 22 '13 at 13:09
source share
3 answers

You must attach to the container using the --sig-proxy=false option as follows:

 docker attach --sig-proxy=false NAME 

Then you can use CTRL + C to exit without stopping the container itself.

+68
Nov 26 '13 at 21:48
source share

As Jerome Petazzoni is mentioned in the user docker group :

 Actually, you can SIGKILL the client, and reattach later.
 However, this will disrupt stdin (the container will see EOF on stdin, and if it cares about stdin, eg if it a shell, it will exit).

 To recap:
 docker run -t -i β†’ can be detached with ^ P ^ Q and reattached with docker attach
 docker run -i β†’ cannot be detached with ^ P ^ Q;  will disrupt stdin
 docker run β†’ cannot be detached with ^ P ^ Q;  can SIGKILL client;  can reattach with docker attach
+74
Jun 05 '14 at 2:36 on
source share

Joining:

 docker attach <container name> 

allows to disconnect with Ctrl + d in Docker version 17.04

I know this is old, but since none of the above methods work for me, I thought I would share it.

0
May 04 '17 at 18:39
source share



All Articles