diff --git a/Dockerfile.tmp-integration b/Dockerfile.tmp-integration new file mode 100644 index 00000000..043be25f --- /dev/null +++ b/Dockerfile.tmp-integration @@ -0,0 +1,21 @@ +# Builder image +FROM docker.io/golang:1.18.0-bullseye AS build +ARG VERSION=dev +ENV GOPATH /go +WORKDIR /go/src/headscale + +COPY go.mod go.sum /go/src/headscale/ +RUN go mod download + +COPY . . +RUN CGO_ENABLED=0 go build -o /go/bin/headscale -ldflags="-s -w -X github.com/juanfont/headscale/cmd/headscale/cli.Version=$VERSION" -a ./cmd/headscale +RUN test -e /go/bin/headscale + +# Production image +FROM gcr.io/distroless/base-debian11 + +COPY --from=build /go/bin/headscale /bin/headscale +ENV TZ UTC + +EXPOSE 8080/tcp +CMD ["headscale"] diff --git a/integration_cli_test.go b/integration_cli_test.go index 2f58e71d..a218abbd 100644 --- a/integration_cli_test.go +++ b/integration_cli_test.go @@ -50,7 +50,7 @@ func (s *IntegrationCLITestSuite) SetupTest() { } headscaleBuildOptions := &dockertest.BuildOptions{ - Dockerfile: "Dockerfile", + Dockerfile: "Dockerfile.tmp-integration", ContextDir: ".", } diff --git a/integration_embedded_derp_test.go b/integration_embedded_derp_test.go index ecca8ba5..465ece29 100644 --- a/integration_embedded_derp_test.go +++ b/integration_embedded_derp_test.go @@ -104,7 +104,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() { } headscaleBuildOptions := &dockertest.BuildOptions{ - Dockerfile: "Dockerfile", + Dockerfile: "Dockerfile.tmp-integration", ContextDir: ".", } diff --git a/integration_test.go b/integration_test.go index 2214b893..5a73242a 100644 --- a/integration_test.go +++ b/integration_test.go @@ -228,7 +228,7 @@ func (s *IntegrationTestSuite) SetupSuite() { } headscaleBuildOptions := &dockertest.BuildOptions{ - Dockerfile: "Dockerfile", + Dockerfile: "Dockerfile.tmp-integration", ContextDir: ".", }