add port forwarder

This commit is contained in:
2019-02-18 15:14:12 +08:00
parent cbdedd6a86
commit 308511a7a3
2 changed files with 42 additions and 0 deletions

13
port-forward/Dockerfile Normal file
View File

@@ -0,0 +1,13 @@
FROM alpine:3.8
MAINTAINER Newnius <docker@newnius.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