From 1d68509463124138f04ea736dd3aa75c1e47f574 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 14 Jan 2022 09:19:16 +0100 Subject: [PATCH 1/2] Strip binary, update to go-1.17.6 --- Dockerfile | 3 ++- Dockerfile.alpine | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 0d344268..d5fe3421 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Builder image -FROM golang:1.17.1-bullseye AS build +FROM golang:1.17.6-bullseye AS build ENV GOPATH /go WORKDIR /go/src/headscale @@ -9,6 +9,7 @@ RUN go mod download COPY . . RUN go install -a -ldflags="-extldflags=-static" -tags netgo,sqlite_omit_load_extension ./cmd/headscale +RUN strip /go/bin/headscale RUN test -e /go/bin/headscale # Production image diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 7d90e1ec..8185dbe4 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -1,5 +1,5 @@ # Builder image -FROM golang:1.17.1-alpine AS build +FROM golang:1.17.6-alpine AS build ENV GOPATH /go WORKDIR /go/src/headscale @@ -10,6 +10,7 @@ RUN go mod download COPY . . RUN go install -a -ldflags="-extldflags=-static" -tags netgo,sqlite_omit_load_extension ./cmd/headscale +RUN strip /go/bin/headscale RUN test -e /go/bin/headscale # Production image From febbb6006f040b26bfe30db31ed4dee7ea362540 Mon Sep 17 00:00:00 2001 From: Stefan Majer Date: Fri, 14 Jan 2022 12:59:53 +0100 Subject: [PATCH 2/2] use most recent go 1.17 for tests --- .github/workflows/build.yml | 2 +- .github/workflows/test-integration.yml | 2 +- .github/workflows/test.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 963663a7..589d8c58 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -18,7 +18,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: "1.17.3" + go-version: "1.17" - name: Install dependencies run: | diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index abf46d32..d4179ea2 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: "1.17.3" + go-version: "1.17" - name: Run Integration tests run: go test -tags integration -timeout 30m diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4540482c..651063fc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -17,7 +17,7 @@ jobs: - name: Setup Go uses: actions/setup-go@v2 with: - go-version: "1.17.3" # The Go version to download (if necessary) and use. + go-version: "1.17" # The Go version to download (if necessary) and use. # Install all the dependencies - name: Install dependencies