Temporary fix integration tests with dedicated Dockerfile

This commit is contained in:
Juan Font Alonso 2022-07-31 10:44:09 +02:00
parent f9c4d577e2
commit 100f7190f3
4 changed files with 24 additions and 3 deletions

View file

@ -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"]

View file

@ -50,7 +50,7 @@ func (s *IntegrationCLITestSuite) SetupTest() {
}
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
Dockerfile: "Dockerfile.tmp-integration",
ContextDir: ".",
}

View file

@ -104,7 +104,7 @@ func (s *IntegrationDERPTestSuite) SetupSuite() {
}
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
Dockerfile: "Dockerfile.tmp-integration",
ContextDir: ".",
}

View file

@ -228,7 +228,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
}
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
Dockerfile: "Dockerfile.tmp-integration",
ContextDir: ".",
}