Docker Community Forums

Share and learn in the Docker community.

Docker container with host network and bridge network


(Shobhit2711) #1

Hi All

I am new to docker container framework so request suggestions on the below problem.

I am trying to run a container with networking set to my own user defined bridge as well as host networking .

The bridge network would be used for containers sharing the bridge network .

The host network would be used to communicate with docker host application .

Here is the command I used to create my container -

docker run -itd --net=host --net=sample-net centos where sample-net is my own user defined bridge .

I have a process running on loopback interface on the host but if i try to connect it from inside the container it says Connection refused .

Hence I would request feedback if this is the correct way to do it .

Thanks