Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Jack/add arm64 build support #5

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
FROM gcr.io/distroless/static:nonroot
ARG ARCH=amd64
WORKDIR /
COPY bin/manager ./
COPY bin/${ARCH}/manager ./
USER nonroot:nonroot
ENTRYPOINT ["/manager"]
10 changes: 6 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ else
GOBIN=$(shell go env GOBIN)
endif

ARCH?=amd64

all-bootstrap: manager-bootstrap

# Run tests
Expand All @@ -24,7 +26,7 @@ test-bootstrap: generate-bootstrap fmt vet manifests-bootstrap

# Build manager binary
manager-bootstrap: generate-bootstrap fmt vet
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o bin/manager bootstrap/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags '-extldflags "-static"' -o bin/$(ARCH)/manager bootstrap/main.go

# Run against the configured Kubernetes cluster in ~/.kube/config
run-bootstrap: generate-bootstrap fmt vet manifests-bootstrap
Expand Down Expand Up @@ -66,7 +68,7 @@ generate-bootstrap: controller-gen

# Build the docker image
docker-build-bootstrap: manager-bootstrap
docker build . -t ${BOOTSTRAP_IMG}
docker build . -t ${BOOTSTRAP_IMG} --build-arg $(ARCH)

# Push the docker image
docker-push-bootstrap:
Expand Down Expand Up @@ -97,7 +99,7 @@ test-controlplane: generate-controlplane fmt vet manifests-controlplane

# Build manager binary
manager-controlplane: generate-controlplane fmt vet
CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' -o bin/manager controlplane/main.go
CGO_ENABLED=0 GOOS=linux GOARCH=$(ARCH) go build -a -ldflags '-extldflags "-static"' -o bin/$(ARCH)/manager controlplane/main.go

# Run against the configured Kubernetes cluster in ~/.kube/config
run-controlplane: generate-controlplane fmt vet manifests-controlplane
Expand Down Expand Up @@ -130,7 +132,7 @@ generate-controlplane: controller-gen

# Build the docker image
docker-build-controlplane: manager-controlplane
docker build . -t ${CONTROLPLANE_IMG}
docker build . -t ${CONTROLPLANE_IMG} --build-arg $(ARCH)

# Push the docker image
docker-push-controlplane:
Expand Down