Skip to content

Commit

Permalink
Add ARM arch build
Browse files Browse the repository at this point in the history
  • Loading branch information
anFatum committed Aug 30, 2022
1 parent 6cd8115 commit 0a4a03b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ FROM golang AS builder
MAINTAINER "Cuong Manh Le <[email protected]>"

RUN apt-get update && \
dpkg --add-architecture arm64 &&\
apt-get install -y --no-install-recommends build-essential && \
apt-get clean && \
mkdir -p "$GOPATH/src/github.com/bitnami-labs/kubewatch"

ADD . "$GOPATH/src/github.com/bitnami-labs/kubewatch"

RUN cd "$GOPATH/src/github.com/bitnami-labs/kubewatch" && \
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a --installsuffix cgo --ldflags="-s" -o /kubewatch
CGO_ENABLED=0 GOOS=linux GOARCH=$(dpkg --print-architecture) go build -a --installsuffix cgo --ldflags="-s" -o /kubewatch

FROM bitnami/minideb:bullseye
RUN install_packages ca-certificates
Expand Down
5 changes: 5 additions & 0 deletions build_with_arm.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
docker buildx build \
--platform linux/arm64,linux/amd64 \
--tag $IMAGE \
--push \
$BUILD_CONTEXT

0 comments on commit 0a4a03b

Please sign in to comment.