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