From 8f6e269bac5de1464b921297a2e68bd3102163d5 Mon Sep 17 00:00:00 2001 From: Kristoffer Dalby Date: Fri, 28 Apr 2023 11:59:19 +0200 Subject: [PATCH] setup ko image builder for goreleaser Signed-off-by: Kristoffer Dalby --- .goreleaser.yml | 45 +++++++++++++++++++++++++++++++++++++++++++-- flake.nix | 1 + 2 files changed, 44 insertions(+), 2 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 07efe6f7..44955c82 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -9,7 +9,7 @@ release: builds: - id: headscale - main: ./cmd/headscale/headscale.go + main: ./cmd/headscale mod_timestamp: "{{ .CommitTimestamp }}" env: - CGO_ENABLED=0 @@ -63,7 +63,6 @@ nfpms: bindir: /usr/bin formats: - deb - # - rpm contents: - src: ./config-example.yaml dst: /etc/headscale/config.yaml @@ -80,6 +79,48 @@ nfpms: postinstall: ./docs/packaging/postinstall.sh postremove: ./docs/packaging/postremove.sh +kos: + - id: ghcr + repository: ghcr.io/juanfont/headscale + base_image: gcr.io/distroless/base-debian11 + build: headscale + main: ./cmd/headscale + env: + - CGO_ENABLED=0 + platforms: + - linux/amd64 + - linux/386 + - linux/arm64 + - linux/arm/v7 + - linux/arm/v6 + - linux/arm/v5 + tags: + - latest + - '{{ .Tag }}' + - '{{ .Major }}.{{ .Minor }}.{{ .Patch }}' + - '{{ .Major }}.{{ .Minor }}' + - '{{ .Major }}' + - '{{ if not .Prerelease }}stable{{ end }}' + + - id: dockerhub + build: headscale + base_image: gcr.io/distroless/base-debian11 + repository: headscale/headscale + platforms: + - linux/amd64 + - linux/386 + - linux/arm64 + - linux/arm/v7 + - linux/arm/v6 + - linux/arm/v5 + tags: + - latest + - '{{ .Tag }}' + - '{{ .Major }}.{{ .Minor }}.{{ .Patch }}' + - '{{ .Major }}.{{ .Minor }}' + - '{{ .Major }}' + - '{{ if not .Prerelease }}stable{{ end }}' + checksum: name_template: "checksums.txt" snapshot: diff --git a/flake.nix b/flake.nix index 3576e3a0..c3fc64bc 100644 --- a/flake.nix +++ b/flake.nix @@ -95,6 +95,7 @@ gotestsum gotests ksh + ko # 'dot' is needed for pprof graphs # go tool pprof -http=: