How do i detach from a docker container without exiting?



  • Note: The container has to be associated with a tty.

    Run a container.

    $ docker run -it alpine /bin/sh
    / #
    

    Detach from the container, Type Ctrl-p Ctrl-q Running docker ps you can see the container still exists.

    / # 
    dockerhost $> docker ps       
    CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS              PORTS               NAMES
    d8c93ae46ef5        alpine              "/bin/sh"           3 minutes ago       Up 3 minutes                            focused_morse
    

Log in to reply
 

© Lightnetics 2024