Skip to content

Commit

Permalink
fix: goreleaser use compiled binaries in release (#76)
Browse files Browse the repository at this point in the history
  • Loading branch information
Demonsthere authored Oct 30, 2023
1 parent 8b50515 commit 6bafc18
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 4 deletions.
File renamed without changes.
File renamed without changes.
8 changes: 8 additions & 0 deletions .docker/Dockerfile-release
Original file line number Diff line number Diff line change
@@ -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"]
49 changes: 46 additions & 3 deletions .goreleaser.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -34,13 +72,18 @@ dockers:
goarch: amd64
build_flag_templates:
- "--platform=linux/amd64"
dockerfile: ".docker/Dockerfile-release"
ids:
- "linux-amd64"
- image_templates:
- "oryd/oathkeeper-maester:{{ .Tag }}-arm64"
- "oryd/oathkeeper-maester:{{ .ShortCommit }}-arm64"
- "oryd/oathkeeper-maester:latest"
goarch: arm64
build_flag_templates:
- "--platform=linux/arm64"
dockerfile: ".docker/Dockerfile-release"
ids:
- "linux-arm64"

release:
prerelease: auto
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,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

Expand Down

0 comments on commit 6bafc18

Please sign in to comment.