Skip to content

Commit d9ea5d0

Browse files
chore: Add multi-architecture build support (#168)
1 parent 7b3543b commit d9ea5d0

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
# Use distroless as minimal base image to package the manager binary
22
# Refer to https://github.com/GoogleContainerTools/distroless for more details
33
FROM gcr.io/distroless/static:nonroot
4+
ARG TARGETARCH
45
WORKDIR /
5-
COPY ./dist/manager .
6+
COPY ./dist/manager-${TARGETARCH} /manager
67

78
USER 65532:65532
89

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,8 @@ lint: golangci-lint ## Run go lint
122122
${GOLANGCI_LINT} run -v -c .golangci.yaml ./...
123123

124124
.PHONY: build
125-
build: clean ## build operator's binary
126-
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME} -gcflags '${GCFLAGS}' ./cmd
125+
build: ## build operator's binary
126+
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/${BIN_NAME}-${HOST_ARCH} -gcflags '${GCFLAGS}' ./cmd
127127

128128
.PHONY: clean
129129
clean: ## clean up

0 commit comments

Comments
 (0)