简体   繁体   中英

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? 在此处输入图片说明

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?

ps excuse me for my english

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM