Use configurable BASEIMAGE and RUNNERIMAGE

Following example on /cluster/images/etcd/Makefile
This commit is contained in:
Wilson E. Husin 2021-03-12 12:47:03 -08:00
parent 00d2a17b2a
commit b1c049efd8
2 changed files with 14 additions and 5 deletions

View File

@ -13,13 +13,14 @@
# limitations under the License. # limitations under the License.
ARG BASEIMAGE ARG BASEIMAGE
ARG RUNNERIMAGE
FROM gcr.io/k8s-staging-build-image/debian-base:v2.1.3 as base FROM ${BASEIMAGE} as debbase
FROM ${BASEIMAGE} FROM ${RUNNERIMAGE}
# This is a dependency for `kubectl diff` tests # This is a dependency for `kubectl diff` tests
COPY --from=base /usr/bin/diff /usr/local/bin/ COPY --from=debbase /usr/bin/diff /usr/local/bin/
COPY cluster /kubernetes/cluster COPY cluster /kubernetes/cluster
COPY ginkgo /usr/local/bin/ COPY ginkgo /usr/local/bin/

View File

@ -31,8 +31,15 @@ E2E_GO_RUNNER_BIN?=$(shell test -f $(LOCAL_OUTPUT_PATH)/go-runner && echo $(LOCA
CLUSTER_DIR?=$(shell pwd)/../../../cluster/ CLUSTER_DIR?=$(shell pwd)/../../../cluster/
BASEIMAGE=gcr.io/distroless/base:latest ifeq ($(ARCH),amd64)
TEMP_DIR:=$(shell mktemp -d -t conformanceXXXXXX) BASEIMAGE?=${KUBE_BASE_IMAGE_REGISTRY}/build-image/debian-base:v2.1.3
else
BASEIMAGE?=${KUBE_BASE_IMAGE_REGISTRY}/build-image/debian-base-${ARCH}:v2.1.3
endif
RUNNERIMAGE?=gcr.io/distroless/static:latest
TEMP_DIR:=$(shell mktemp -d -t conformance-XXXXXX)
all: build all: build
@ -60,6 +67,7 @@ endif
--pull \ --pull \
-t ${REGISTRY}/conformance-${ARCH}:${VERSION} \ -t ${REGISTRY}/conformance-${ARCH}:${VERSION} \
--build-arg BASEIMAGE=$(BASEIMAGE) \ --build-arg BASEIMAGE=$(BASEIMAGE) \
--build-arg RUNNERIMAGE=$(RUNNERIMAGE) \
${TEMP_DIR} ${TEMP_DIR}
rm -rf "${TEMP_DIR}" rm -rf "${TEMP_DIR}"