Skip to content

Commit

Permalink
arm64 docker builds for chamber
Browse files Browse the repository at this point in the history
  • Loading branch information
kevcube committed May 31, 2022
1 parent 8b2e029 commit 93876ad
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ FROM golang:1.13-alpine AS build
WORKDIR /go/src/github.com/segmentio/chamber
COPY . .

ARG TARGETARCH
ARG VERSION
RUN test -n "${VERSION}"

RUN apk add -U make ca-certificates
RUN make linux VERSION=${VERSION}
RUN make linux VERSION=${VERSION} TARGETARCH=${TARGETARCH}

FROM scratch AS run

Expand Down
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ ifndef VERSION
VERSION := $(shell git describe --tags --always --dirty="-dev")
endif

ifndef TARGETARCH
TARGETARCH := $(shell arch)
endif

VERSION_NO_V := $(shell echo "$(VERSION)" | sed 's/^v//')
VERSION_MAJOR_MINOR_PATCH := $(shell echo "$(VERSION)" | sed 's/^v\([0-9]*.[0-9]*.[0-9]*\).*/\1/')
VERSION_MAJOR_MINOR := $(shell echo "$(VERSION)" | sed 's/^v\([0-9]*.[0-9]*\).*/\1/')
Expand Down Expand Up @@ -37,7 +41,7 @@ dist/chamber-$(VERSION)-darwin-amd64: | dist/
dist/chamber-$(VERSION)-darwin-arm64: | dist/
GOOS=darwin GOARCH=arm64 CGO_ENABLED=0 go build -trimpath $(LDFLAGS) -o $@

linux: dist/chamber-$(VERSION)-linux-amd64
linux: dist/chamber-$(VERSION)-linux-$(TARGETARCH)
cp $^ chamber

dist/chamber-$(VERSION)-linux-amd64: | dist/
Expand Down

0 comments on commit 93876ad

Please sign in to comment.