To detach the tty without exiting the shell, use the escape sequence Ctrl-p + Ctrl-q. The container will continue to exist in a stopped state once exited.
Can we do that with a command from within the container console (to be eventually leveraged by a script inside the container)?
I needed this because I have a central script that open console windows to multiple containers, and each time it needs to get back to the main script to perform other tasks.
Not if you run it with interactive mode “-ti” and pass “/bin/bash” to the container.
I agree that it is a peculiar case, but I needed that for the earlier intergration testing with GNS3: https://github.com/AJNOURI/DockerVPC
But this is not needed anymore, because now Docker is officially integrated into GNS3 “natively” and provide console access to the containes on-demand:
Here is an example:
I hope I 've made myself clear about the context of the post.