Start Docker With Multiple Tty/Terminal/Console

Oct 30, 2020

run -ti

If you start docker with

docker run -ti --name NAME DOCKER_IMAGE

When you exit the terminal, the docker instance is terminated.

You can connect a second tty via

docker exec -ti NAME bash

run -td

You can start a docker instance detached (run in background)

docker run -td --name NAME DOCKER_IMAGE

Then you can connnect one or more tty

docker exec -ti NAME bash

Commands

To stop the instance

docker stop NAME

To start the instance again

docker start NAME

To check running docker instance

docker ps

NOTE: To list docker instances which stopped docker ps -a

To remove the instance name (so you can reuse the name for different config)

docker rm NAME

NOTE: Setup Docker for Local Development

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.