How to get many instance of the same docker image

Hello every one,

I’m new to Docker , and i’m wondering how to get two or three instance of the same docker image.

As a result when I execute docker ps i get :

 Container-------- Image-------- PORT
 web-app-dev-01 ------- WEB-APP ----- 8082:80 
 web-app-dev-02 --------- WEB-APP ---- 80883:80

Each instance have a unique port and configuration.

Thank you very much for your help.

there is no port 80883, so I guess this is just handwritten. :slight_smile:

just run it multiple times

docker run -d -p 8082:80 YOUR_IMAGE
and
docker run -d -p 8083:80 YOUR_IMAGE

Then both containers run in the background.

Thank you for your response , but i need just to confirm the result:

#docker ps
CONTAINER ID IMAGE COMMAND PORTS NAMES
xxxxxxxxxxxx nginx xxxxxxxxx 0.0.0.0:7070->80 name
xxxxxxxxxxxx nginx xxxxxxxxx 0.0.0.0:7060->80 name1

Is like this one?

yes, looks good.
and you should be able to check your two webservers on http://localhost:7070 and http://localhost:7060

OK , thank you for your response.

I am having trouble making this work. For some reason the container in question (rocker/rstudio) only works in one port (8787) and is not possible to open in another. I can run it in bash, but that’s not what I want. Any advise on how to be able to run a container on multiple ports in such a situation?