user3169724
user3169724

Reputation: 39

External access to the docker containers

Is it possible to make docker containers (network) visible for another computers in local network without exposing ports to the host machine where containers placed?enter image description here

I have a local network that contains several machines. One of these (192.168.1.10) has docker containers (dns, nginx, mysql) and also this machine has nginx and mysql installed on itself.

I want to get access to the dns/nginx from another machines in the local network. Is it possible without exposing ports to the host machine?

p.s. excuse me for my english

Upvotes: 0

Views: 49

Answers (1)

mr4kino
mr4kino

Reputation: 411

You can do this using DNAT (destination NAT) internally. You will need a layer 3 device that does this though.

Example: you create a "VIP" 192.168.1.111 on port XYZ. This will be NATed to the IP address of 192.168.1.10 on port say 53 (for DNS) or another port of your choice.

Upvotes: 1

Related Questions