Compare commits

...

2 Commits

Author SHA1 Message Date
Juan Font Alonso
5539ef1f8f Reduce the number of containers 2022-08-04 21:36:38 +02:00
Juan Font Alonso
100f7190f3 Temporary fix integration tests with dedicated Dockerfile 2022-07-31 10:44:09 +02:00
4 changed files with 25 additions and 4 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

@@ -53,7 +53,7 @@ func TestIntegrationTestSuite(t *testing.T) {
s.namespaces = map[string]TestNamespace{
"thisspace": {
count: 10,
count: 5,
tailscales: make(map[string]dockertest.Resource),
},
"otherspace": {
@@ -228,7 +228,7 @@ func (s *IntegrationTestSuite) SetupSuite() {
}
headscaleBuildOptions := &dockertest.BuildOptions{
Dockerfile: "Dockerfile",
Dockerfile: "Dockerfile.tmp-integration",
ContextDir: ".",
}