Skip to content

Commit

Permalink
Add turncat
Browse files Browse the repository at this point in the history
  • Loading branch information
levaitamas committed May 12, 2023
1 parent 1ad6c36 commit 387fbf9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,22 @@
###########
# BUILD
# Build turncat
FROM golang:1.19-alpine as builder

WORKDIR /app
RUN apk add --no-cache git tar wget upx
RUN wget https://github.com/l7mp/stunner/archive/refs/tags/v0.15.0.tar.gz -O stunner.tar.gz \
&& tar --strip-components=1 -zxf stunner.tar.gz -C .
RUN apkArch="$(apk --print-arch)"; \
case "$apkArch" in \
aarch64) export GOARCH='arm64' ;; \
*) export GOARCH='amd64' ;; \
esac; \
CGO_ENABLED=0 GOOS=linux go build -ldflags="-w -s" -trimpath -o turncat cmd/turncat/main.go
RUN upx --lzma turncat

####
# NET-DEBUG
FROM alpine:3.18

RUN apk add --no-cache \
Expand Down Expand Up @@ -31,4 +50,6 @@ RUN curl -Lo /usr/bin/websocat \

# RUN /usr/sbin/sysctl -w net.ipv4.ip_forward=0

COPY --from=builder /app/turncat /usr/bin/

CMD exec /bin/bash -c "trap : TERM INT; sleep infinity & wait"

0 comments on commit 387fbf9

Please sign in to comment.