Skip to content

Commit

Permalink
add a BUILD_IMAGE variable to the Makefile
Browse files Browse the repository at this point in the history
This change helps make it easier substitute different build images when
using the makefile. The user can now specify an alternate container
image to use for building the mao binaries, for example
`BUILD_IMAGE=quay.io/foo/mybuilder make build`.
  • Loading branch information
elmiko committed Nov 11, 2021
1 parent b045e9d commit 7d4d390
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ REPO_PATH ?= sigs.k8s.io/cluster-api-provider-aws
LD_FLAGS ?= -X $(REPO_PATH)/pkg/version.Raw=$(VERSION) -extldflags "-static"
MUTABLE_TAG ?= latest
IMAGE = origin-aws-machine-controllers
BUILD_IMAGE ?= openshift/origin-release:golang-1.16

# race tests need CGO_ENABLED, everything else should have it disabled
CGO_ENABLED = 0
Expand Down Expand Up @@ -60,7 +61,7 @@ ifeq ($(NO_DOCKER), 1)
DOCKER_CMD =
IMAGE_BUILD_CMD = imagebuilder
else
DOCKER_CMD = $(ENGINE) run --rm -e CGO_ENABLED=$(CGO_ENABLED) -e GOARCH=$(GOARCH) -e GOOS=$(GOOS) -v "$(PWD)":/go/src/sigs.k8s.io/cluster-api-provider-aws:Z -w /go/src/sigs.k8s.io/cluster-api-provider-aws openshift/origin-release:golang-1.16
DOCKER_CMD = $(ENGINE) run --rm -e CGO_ENABLED=$(CGO_ENABLED) -e GOARCH=$(GOARCH) -e GOOS=$(GOOS) -v "$(PWD)":/go/src/sigs.k8s.io/cluster-api-provider-aws:Z -w /go/src/sigs.k8s.io/cluster-api-provider-aws $(BUILD_IMAGE)
IMAGE_BUILD_CMD = $(ENGINE) build
endif

Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module sigs.k8s.io/cluster-api-provider-aws

go 1.16
go 1.17

require (
github.com/aws/aws-sdk-go v1.38.23
Expand Down

0 comments on commit 7d4d390

Please sign in to comment.