I need to launch two distinct processes on a docker container which requires two terminals.What is the best way to achieve this?
In your Dockerfile , you can use the verb EXPOSE to expose multiple ports.
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>
docker ps
will show the container_id that you just fired up from said image. Per @eltonStoneman's advice: docker exec -it <container_id> bash
Open up another docker terminal and perform step 3 to create another interactive terminal to the container. (Rinse and Repeat)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With