How to open multiple terminals in docker?
You can run docker exec -it <container> bash
from multiple terminals to launch several sessions connected to the same container.
To expand on @eltonStoneman's great answer (For all those new docker folks like me):
Open a docker terminal
-
Get the image running as a container in the background:
docker run -d -it <image_id>
-
Tip:
docker ps
will show the container_id that you just fired up from said image.
-
Tip:
-
Per @eltonStoneman's advice:
docker exec -it <container_id> bash
- Now your docker terminal is showing an interactive terminal to the container.
Open up another docker terminal and perform step 3 to create another interactive terminal to the container. (Rinse and Repeat)
docker run -it container_name bash
starts a new container with bash promt.
docker exec -it container_name bash
joins already running container's bash prompt.