Last active
August 11, 2017 12:11
-
-
Save misraX/fca0c30412c441d269fed4855efbc665 to your computer and use it in GitHub Desktop.
Exposing TCP Ports Using Socat's Container
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 | |
### | |
# socat container to forward tcp ports from system wide running containers or network services | |
### | |
# Define the ip | |
ip=172.17.0.2 | |
# Define port number | |
port=8080 | |
# Running socat container to forward the service using it's ip and port number | |
docker run -ti --rm --net host bobrik/socat TCP4-LISTEN:$(port) TCP4:$(ip):$(port) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment