add rpi-port-forward

This commit is contained in:
Newnius 2018-04-13 15:18:58 +08:00
parent b7cc5b85fc
commit beea521043
2 changed files with 26 additions and 0 deletions

View File

@ -0,0 +1,13 @@
FROM hypriot/rpi-alpine-scratch:v3.4
MAINTAINER Newnius <newnius.cn@gmail.com>
ARG DEF_REMOTE_PORT=80
ARG DEF_LOCAL_PORT=80
ENV REMOTE_PORT=$DEF_REMOTE_PORT
ENV LOCAL_PORT=$DEF_LOCAL_PORT
RUN apk add --no-cache socat
CMD socat tcp-listen:$LOCAL_PORT,reuseaddr,fork tcp:$REMOTE_HOST:$REMOTE_PORT

View File

@ -0,0 +1,13 @@
# forward your traffic behind NAT etc.
```
docker service create \
--name socat \
--publish 81:80 \
--ENV REMOTE_HOST=example.com \
--ENV REMOTE_PORT=82 \
--ENV LOCAL_POST=80 \
newnius/rpi-port-forward
```
Ref: [marcnuri/port-forward](https://hub.docker.com/r/marcnuri/port-forward/)