Is it possible to connect a docker instance to only one specific network interface?

I have a server with two network adapters, one for the private LAN between other servers (let's call it eth1) and the other for the public (let's call it eth0).

I have a docker instance setup on the server in order for the client to be able to host the website. Can network traffic be routed with eth0 only? I don't want the client to be able to access the private LAN.

If this is not possible, is there another solution?

+3
linux docker


source to share


1 answer


This should be possible taking into account the type of insulation docker network

. You can even define your own network .

With a bridge network made on the server using eth0, you can define containers using only this network:

docker network create --driver bridge isolated_nw
docker run --net=isolated_nw -itd --name=container3 busybox

      



The containers you run on this network must be on the same Docker host. Each container on the network can immediately communicate with other containers on the network. Although the network itself isolates containers from external networks.

http://docs.docker.com/engine/userguide/networking/images/bridge_network.png

+2


source to share







All Articles