mirror of
https://github.com/newnius/Dockerfiles.git
synced 2025-06-06 16:11:55 +00:00
add rpi-port-forward
This commit is contained in:
parent
b7cc5b85fc
commit
beea521043
13
rpi-port-forward/Dockerfile
Normal file
13
rpi-port-forward/Dockerfile
Normal 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
|
13
rpi-port-forward/README.md
Normal file
13
rpi-port-forward/README.md
Normal 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/)
|
Loading…
Reference in New Issue
Block a user