Skip to content

Commit

Permalink
Create Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
georgepstaylor committed Sep 2, 2024
1 parent fb55d66 commit 3da230d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions tools/port-forward/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM alpine:3

RUN apk add --update --no-cache socat \
&& rm -rf /var/cache/apk/

RUN addgroup -g 1001 -S appgroup && \
adduser -u 1001 -S appuser -G appgroup

USER 1001

CMD ["sh", "-c", "socat tcp-listen:$LOCAL_PORT,reuseaddr,fork tcp:$REMOTE_HOST:$REMOTE_PORT & pid=$! && trap \"kill $pid\" SIGINT && echo \"Socat started listening on $LOCAL_PORT: Redirecting traffic to $REMOTE_HOST:$REMOTE_PORT ($pid)\" && wait $pid"]

0 comments on commit 3da230d

Please sign in to comment.