From f44138c944c35edf3a6ab8f2b4249992ef9ef96c Mon Sep 17 00:00:00 2001 From: "Alessandro (Ale) Segala" <43508+ItalyPaleAle@users.noreply.github.com> Date: Fri, 12 Nov 2021 02:20:46 +0000 Subject: [PATCH] Added debug container --- Dockerfile.debug | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 Dockerfile.debug diff --git a/Dockerfile.debug b/Dockerfile.debug new file mode 100644 index 00000000..2d99faec --- /dev/null +++ b/Dockerfile.debug @@ -0,0 +1,24 @@ +# Builder image +FROM golang:1.17.1-bullseye AS build +ENV GOPATH /go +WORKDIR /go/src/headscale + +COPY go.mod go.sum /go/src/headscale/ +RUN go mod download + +COPY . . + +RUN go install -a -ldflags="-extldflags=-static" -tags netgo,sqlite_omit_load_extension ./cmd/headscale +RUN test -e /go/bin/headscale + +# Debug image +FROM gcr.io/distroless/base-debian11:debug + +COPY --from=build /go/bin/headscale /headscale +ENV TZ UTC +ENV PATH="/:$PATH" + +# Need to reset the entrypoint or everything will run as a busybox script +ENTRYPOINT [] +EXPOSE 8080/tcp +CMD ["headscale"]