Skip to content

Commit

Permalink
#282 arm image build
Browse files Browse the repository at this point in the history
  • Loading branch information
rusenask committed Oct 7, 2018
1 parent f83b58f commit f571b82
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Dockerfile.aarch64
@@ -0,0 +1,4 @@
FROM arm64v8/alpine:3.8
ADD ca-certificates.crt /etc/ssl/certs/
COPY cmd/keel/release/keel-linux-aarch64 /keel
ENTRYPOINT ["/keel"]
4 changes: 4 additions & 0 deletions Dockerfile.armhf
@@ -0,0 +1,4 @@
FROM arm32v6/alpine:3.8
ADD ca-certificates.crt /etc/ssl/certs/
COPY cmd/keel/release/keel-linux-arm /keel
ENTRYPOINT ["/keel"]
27 changes: 27 additions & 0 deletions Makefile
Expand Up @@ -2,12 +2,39 @@ JOBDATE ?= $(shell date -u +%Y-%m-%dT%H%M%SZ)
GIT_REVISION = $(shell git rev-parse --short HEAD)
VERSION ?= $(shell git describe --tags --abbrev=0)

LDFLAGS += -s -w
LDFLAGS += -X github.com/keel-hq/keel/version.Version=$(VERSION)
LDFLAGS += -X github.com/keel-hq/keel/version.Revision=$(GIT_REVISION)
LDFLAGS += -X github.com/keel-hq/keel/version.BuildDate=$(JOBDATE)

.PHONY: release

fetch-certs:
curl --remote-name --time-cond cacert.pem https://curl.haxx.se/ca/cacert.pem
cp cacert.pem ca-certificates.crt

compress:
upx --brute cmd/keel/release/keel-linux-arm
upx --brute cmd/keel/release/keel-linux-aarch64

build-binaries:
go get github.com/mitchellh/gox
@echo "++ Building keel binaries"
cd cmd/keel && gox -verbose -output="release/{{.Dir}}-{{.OS}}-{{.Arch}}" \
-ldflags "$(LDFLAGS)" -osarch="linux/arm"
@echo "++ building aarch64 binary"
cd cmd/keel && env GOARCH=arm64 GOOS=linux go build -ldflags="-s -w" -o release/keel-linux-aarch64

armhf:
docker build -t keelhq/keel-arm:latest -f Dockerfile.armhf .
docker push keelhq/keel-arm:latest

aarch64:
docker build -t keelhq/keel-aarch64:latest -f Dockerfile.aarch64 .
docker push keelhq/keel-aarch64:latest

arm: build-binaries compress fetch-certs armhf aarch64

test:
go test -v `go list ./... | egrep -v /vendor/`

Expand Down

0 comments on commit f571b82

Please sign in to comment.