Search code examples
linuxapachedockerdevopsdocker-network

Multiple bridge network in docker?


I have a physical server with two networks:

- eth0: with IP: x.x.x.x for public network
- eth1: with IP: y.y.y.y for local network

Now I deploy a docker container in this server. But I want to public port 1024 for receive data through eth1 and public port 80 for access web UI (apache) through eth0.

How can I configure multiple bridge network in docker and start it?


Solution

  • You may not need another bridge network. If you're already publishing ports with bridge networking, the solution may be simple as telling Docker which address to use for each port:

    docker run yada yada -p x.x.x.x:80:80 -p y.y.y.y:1024:1024