Docker Community Forums

Share and learn in the Docker community.

How to specify eth0 or eth1 for "docker run -p port:port"


(Moonsyim) #1

Hello,

my machine has 2 network interfaces such as eth0, eth1.
I’d like to run 2 containers like
"docker run -p eth0.port:port application A"
"docker run -p eth1.port:port application B"
is it possible?
I have tried a couple of ways like eth0, eth1 or ip_address but all have syntax error.
Would you please share your option for this?


(Sven Dowideit) #2

The syntax should be something like:

$ docker run -d -p 127.0.0.1:80:5000 training/webapp python app.py

see http://docs.docker.com/userguide/dockerlinks/