Skip to content

Commit

Permalink
add xc-prod-image for cross compiling vault-k8s image in release pipe…
Browse files Browse the repository at this point in the history
…line (hashicorp#221)
  • Loading branch information
alvin-huang authored Feb 22, 2021
1 parent 2a32118 commit 2593259
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
REGISTRY_NAME?=docker.io/hashicorp
IMAGE_NAME=vault-k8s
VERSION?=0.8.0
IMAGE_TAG=$(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION)
IMAGE_TAG?=$(REGISTRY_NAME)/$(IMAGE_NAME):$(VERSION)
PUBLISH_LOCATION?=https://releases.hashicorp.com
DOCKER_DIR=./build/docker
BUILD_DIR=.build
GOOS?=linux
GOARCH?=amd64
BIN_NAME=$(IMAGE_NAME)_$(GOOS)_$(GOARCH)_$(VERSION)
GOFMT_FILES?=$$(find . -name '*.go' | grep -v vendor)
XC_PUBLISH?=

.PHONY: all test build image clean
.PHONY: all test build image clean
all: build

build:
Expand All @@ -33,6 +34,16 @@ prod-ubi-image:
--build-arg LOCATION=$(PUBLISH_LOCATION) \
-f $(DOCKER_DIR)/Release.ubi.dockerfile .

# This target is used in CI to cross compile vault-k8s for 4 different architectures
# and publish (when XC_PUBLISH="--push") using docker buildx
xc-prod-image:
docker buildx build --platform linux/amd64,linux/arm64,linux/386,linux/arm/v6 \
--build-arg VERSION="${RELEASE_VERSION}" \
--build-arg LOCATION="${PUBLISH_LOCATION}" \
$(XC_PUBLISH) \
-t $(IMAGE_TAG) \
-f ${DOCKER_DIR}/Release.dockerfile .

clean:
-rm -rf $(BUILD_DIR)

Expand Down

0 comments on commit 2593259

Please sign in to comment.