Docker Community Forums

Share and learn in the Docker community.

Connect to a container running on bridge network


(Bpathak) #1


I have created a docker bridge network on my host using the following command -

docker network create --driver=bridge --subnet= --ip-range= --gateway= br0

I created a centos container & attached it to the bridge network using the following command -

docker run -it -d -v /etc/localtime:/etc/localtime:ro --network=br0 --ip= --name=container1 centos /usr/bin/’

This container is on br0, other applications talking to it also are deployed on br0. This is the required behavior, but sometimes for debugging purposes, we need to connect to the container without changing it’s network.

Is there a way to connect to the docker container running on the IP from outside the host? Maybe temporarily create a tunnel or a reverse proxy to help out in this case.

Bhushan Pathak