Skip to content

Commit

Permalink
change build to fix release
Browse files Browse the repository at this point in the history
  • Loading branch information
sergicastro committed Aug 12, 2024
1 parent a6700ac commit 881f1f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM gcr.io/distroless/static:nonroot

ARG TARGETOS
ARG TARGETARCH
ARG BUILDPLATFORM
ARG TARGETPLATFORM

WORKDIR /
COPY build/bin/manager-${TARGETOS}-${TARGETARCH} manager
COPY build/bin/${TARGETPLATFORM}/manager manager
USER 65532:65532

ENTRYPOINT ["/manager"]
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ help: ## Display this help.

##@ Development

.PHONY: clean
clean: ## Clean build files
rm -rf build

.PHONY: manifests
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
Expand Down Expand Up @@ -83,7 +87,7 @@ build/%: PLATFORM=$(*)
build/%: GOARCH=$(notdir $(PLATFORM))
build/%: GOOS=$(subst /,,$(dir $(PLATFORM)))
build/%: ## Build manager binary for a specific platform.
GOOS=${GOOS} GOARCH=${GOARCH} go build -o build/bin/manager-$(GOOS)-$(GOARCH) main.go
GOOS=${GOOS} GOARCH=${GOARCH} go build -o build/bin/$(PLATFORM)/manager main.go

.PHONY: run
run: install ## Run a controller from your host.
Expand Down

0 comments on commit 881f1f6

Please sign in to comment.