Last active
August 11, 2017 12:10
-
-
Save misraX/815576df882736b1886f2410c9d92867 to your computer and use it in GitHub Desktop.
Exposing Docker ports to host machine using iptables.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ip=172.17.0.2 | |
port=8080 | |
iptables -t nat -A DOCKER -p tcp --dport $(port) -j DNAT --to-destination $(ip):$(port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment