Skip to content

Commit 1eb1ec7

Browse files
chore: Add multi-arch build support (#31)
1 parent c142f14 commit 1eb1ec7

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
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/api .
6+
COPY ./dist/api-${TARGETARCH} /api
67

78
USER 65532:65532
89

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ $(LOCALBIN):
2626

2727
.PHONY: build
2828
build: ## build binary
29-
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/api -gcflags '${GCFLAGS}' ./cmd/gitfusion-api
29+
CGO_ENABLED=0 GOOS=${HOST_OS} GOARCH=${HOST_ARCH} go build -v -ldflags '${LDFLAGS}' -o ${DIST_DIR}/api-${HOST_ARCH} -gcflags '${GCFLAGS}' ./cmd/gitfusion-api
3030

3131
.PHONY: generate
3232
generate: oapi-codegen # Generate the server code from OpenAPI spec

0 commit comments

Comments
 (0)