fix: goreleaser use compiled binaries in release (#138)
This commit is contained in:
parent
0df31d3f3a
commit
91b139e6f2
8
.docker/Dockerfile-release
Normal file
8
.docker/Dockerfile-release
Normal file
@ -0,0 +1,8 @@
|
||||
# Use distroless as minimal base image to package the manager binary
|
||||
# Refer to https://github.com/GoogleContainerTools/distroless for more details
|
||||
FROM gcr.io/distroless/static:nonroot
|
||||
WORKDIR /
|
||||
COPY manager .
|
||||
USER 65532:65532
|
||||
|
||||
ENTRYPOINT ["/manager"]
|
3
.github/workflows/ci.yaml
vendored
3
.github/workflows/ci.yaml
vendored
@ -50,8 +50,7 @@ jobs:
|
||||
- '*.go'
|
||||
- 'PROJECT'
|
||||
docker:
|
||||
- 'Dockerfile'
|
||||
- 'Dockerfile-kubebuilder'
|
||||
- '.docker/**'
|
||||
cicd-definitions:
|
||||
- '.github/workflows/**'
|
||||
- '.github/actions/**'
|
||||
|
@ -7,17 +7,55 @@ before:
|
||||
- "go mod download"
|
||||
|
||||
builds:
|
||||
- flags:
|
||||
- id: linux-amd64
|
||||
flags:
|
||||
- -a
|
||||
binary: manager
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goarch:
|
||||
- amd64
|
||||
- 386
|
||||
goos:
|
||||
- linux
|
||||
- id: linux-arm64
|
||||
flags:
|
||||
- -a
|
||||
binary: manager
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goarch:
|
||||
- arm64
|
||||
goos:
|
||||
- linux
|
||||
- id: linux-i386
|
||||
flags:
|
||||
- -a
|
||||
binary: manager
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goarch:
|
||||
- 386
|
||||
goos:
|
||||
- linux
|
||||
- id: darwin-amd64
|
||||
flags:
|
||||
- -a
|
||||
binary: manager
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goarch:
|
||||
- amd64
|
||||
goos:
|
||||
- darwin
|
||||
- id: darwin-arm64
|
||||
flags:
|
||||
- -a
|
||||
binary: manager
|
||||
env:
|
||||
- CGO_ENABLED=0
|
||||
goarch:
|
||||
- arm64
|
||||
goos:
|
||||
- darwin
|
||||
|
||||
snapshot:
|
||||
@ -25,14 +63,28 @@ snapshot:
|
||||
|
||||
changelog:
|
||||
sort: asc
|
||||
use: github-native
|
||||
|
||||
dockers:
|
||||
- image_templates:
|
||||
- "oryd/hydra-maester:v{{ .Major }}"
|
||||
- "oryd/hydra-maester:v{{ .Major }}.{{ .Minor }}"
|
||||
- "oryd/hydra-maester:v{{ .Major }}.{{ .Minor }}.{{ .Patch }}"
|
||||
- "oryd/hydra-maester:{{ .ShortCommit }}"
|
||||
- "oryd/hydra-maester:{{ .Tag }}-amd64"
|
||||
- "oryd/hydra-maester:{{ .ShortCommit }}-amd64"
|
||||
- "oryd/hydra-maester:latest"
|
||||
goarch: amd64
|
||||
build_flag_templates:
|
||||
- "--platform=linux/amd64"
|
||||
dockerfile: ".docker/Dockerfile-release"
|
||||
ids:
|
||||
- "linux-amd64"
|
||||
- image_templates:
|
||||
- "oryd/hydra-maester:{{ .Tag }}-arm64"
|
||||
- "oryd/hydra-maester:{{ .ShortCommit }}-arm64"
|
||||
goarch: arm64
|
||||
build_flag_templates:
|
||||
- "--platform=linux/arm64"
|
||||
dockerfile: ".docker/Dockerfile-release"
|
||||
ids:
|
||||
- "linux-arm64"
|
||||
|
||||
release:
|
||||
prerelease: auto
|
||||
|
2
Makefile
2
Makefile
@ -169,7 +169,7 @@ generate: controller-gen
|
||||
# Build the docker image
|
||||
.PHONY: docker-build-notest
|
||||
docker-build-notest:
|
||||
docker build . -t ${IMG}
|
||||
docker build . -t ${IMG} -f .docker/Dockerfile-build
|
||||
@echo "updating kustomize image patch file for manager resource"
|
||||
sed -i'' -e 's@image: .*@image: '"${IMG}"'@' ./config/default/manager_image_patch.yaml
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user