Dockerfiles/port-forward/README.md

30 lines
845 B
Markdown
Raw Permalink Normal View History

2019-02-18 07:14:12 +00:00
port-forward
==========================
Forward your traffic behind NAT, expose certain services in containers etc.
## Usage
Define the following environment variables to configure port-forwarding.
Variable | Description | Optional
-------- | ----------- | --------
REMOTE_HOST | IP or address of the host you want to forward traffic to | no
REMOTE_PORT | Port on remote host to forward traffic to | yes (80)
LOCAL_PORT | Port where container listens | yes (80)
The `socat` process within the container will listen by default to port 80, use `-p`docker
flag to map the port of the local machine where it will listen to traffic to be forwarded.
```bash
docker run \
--name port-forward \
-d \
--restart always \
--publish 81:80 \
--ENV REMOTE_HOST=example.com \
--ENV REMOTE_PORT=82 \
2019-02-18 07:53:17 +00:00
--ENV LOCAL_PORT=80 \
2019-02-18 07:14:12 +00:00
newnius/port-forward
```