Skip to content

Commit c3d3f9b

Browse files
chore: Add multi-architecture build support (#210)
1 parent d274499 commit c3d3f9b

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
FROM alpine:3.18.12
22

3+
ARG TARGETARCH
4+
35
ENV ASSETS_DIR=/usr/local/bin \
46
HOME=/home/codebase-operator \
57
OPERATOR=/usr/local/bin/codebase-operator \
@@ -22,7 +24,7 @@ RUN chmod u+x ${ASSETS_DIR}/user_setup && \
2224
${ASSETS_DIR}/user_setup
2325

2426
# install operator binary
25-
COPY ./dist/manager ${OPERATOR}
27+
COPY ./dist/manager-${TARGETARCH} ${OPERATOR}
2628

2729
ENTRYPOINT ["/usr/local/bin/entrypoint"]
2830

Makefile

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

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

112112
.PHONY: clean
113113
clean: ## clean up

0 commit comments

Comments
 (0)