Problems accessing multiple docker containers remotely
I’m trying to set up some docker container demo blogs but I’m having problems when I try to access more than one:
docker run --volumes-from my-data -p 80:8080 --name site1 tutum/wordpress docker run --volumes-from my-data -p 80:8081 --name site2 tutum/wordpress
I can access the first one from myhost:8080 but I can’t access the second one from myhost:8081
Is there anything obvious I’m missing?
One Solution collect form web for “Problems accessing multiple docker containers remotely”
-p argument tells docker how to map external addresses to internal (container) addresses. You are instructing it to map port 80 of all host interfaces to port 8080/8081 of the respective container. Assuming the container processes really listen on port 8080/8081 you might want to try
-p 8080:8080 /
-p8081:8081. If the containers run standard webservers on port 80, you might want to use
-p 8080:80 /
-p 8081:80 instead. The proper port mapping will make the container service accessible on port 8080/8081 of all host interfaces.