diff --git a/Dockerfile b/Dockerfile index e4ed7b7..f27590f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ @@ -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" \ No newline at end of file