유창완
유창완

Reputation: 21

how to open port of docker container with bridge network

I want to open port on docker container. but not using docker run -p option. because container have assigned independent IP address by bridge network. so my system don't need port forwarding.

for example. host OS has IP 172.30.1.2 container has IP 172.30.1.3 so I want to connect the container with 172.30.1.3:80 directly.

then, I tried something using iptables. but it is denied.

are there some way possible?

Upvotes: 2

Views: 7821

Answers (1)

moebius
moebius

Reputation: 2269

You can specify an IP endpoint when exposing ports. For example: -p 172.30.1.3:80:80

Check documentation here

Upvotes: 2

Related Questions