Skip to content

Commit

Permalink
Update pristing build setup for arm builds
Browse files Browse the repository at this point in the history
Need to build a custom docker image for the pristine builds so it will
contain the arm compilers. Then use it for the pristine builds.
  • Loading branch information
eikenb committed Sep 11, 2019
1 parent d1e1dad commit 6cae10f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
15 changes: 12 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ GOTAGS ?=
GOMAXPROCS ?= 4

# Get the project metadata
GO_DOCKER_VERSION ?= 1.12
GO_DOCKER_VERSION ?= 1.13
PROJECT := $(shell go list -m -mod=vendor)
OWNER := "hashicorp"
NAME := $(notdir $(PROJECT))
Expand Down Expand Up @@ -81,7 +81,16 @@ endef
$(foreach goarch,$(XC_ARCH),$(foreach goos,$(XC_OS),$(eval $(call make-xc-target,$(goos),$(goarch),$(if $(findstring windows,$(goos)),.exe,)))))

# Use docker to create pristine builds for release
# First build image w/ arm build requirements, then build all binaries
pristine:
@docker build \
--rm \
--force-rm \
--no-cache \
--compress \
--file="docker/pristine/Dockerfile" \
--build-arg="GOVERSION=${GO_DOCKER_VERSION}" \
--tag="pristine-builder" .
@docker run \
--interactive \
--user $$(id -u):$$(id -g) \
Expand All @@ -90,9 +99,9 @@ pristine:
--volume="${CURRENT_DIR}:/go/src/${PROJECT}" \
--volume="${GOPATH}/pkg/mod:/go/pkg/mod" \
--workdir="/go/src/${PROJECT}" \
--env=CGO_ENABLED="0" \
--env=GO111MODULE=on \
"golang:${GO_DOCKER_VERSION}" env GOCACHE=/tmp make -j4 build
"pristine-builder" \
env GOCACHE=/tmp make -j4 build

# dev builds and installs the project locally.
dev:
Expand Down
8 changes: 8 additions & 0 deletions docker/pristine/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### Used for pristine builds
#
ARG GOVERSION=latest
FROM golang:${GOVERSION}
LABEL maintainer "John Eikenberry <[email protected]>"

RUN apt-get update && \
apt-get -y install gcc-arm-linux-gnueabi gcc-aarch64-linux-gnu

0 comments on commit 6cae10f

Please sign in to comment.