Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parameterize the binary path and host arch for the hyperkube image #47776

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
9 changes: 6 additions & 3 deletions cluster/images/hyperkube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX)
CNI_RELEASE=0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff
CACHEBUST?=1
QEMUVERSION=v2.7.0
HYPERKUBE_BIN?=_output/dockerized/bin/linux/${ARCH}/hyperkube
HOSTARCH?=amd64

UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Darwin)
Expand Down Expand Up @@ -62,7 +64,8 @@ endif
cp -r ./* ${TEMP_DIR}
mkdir -p ${TEMP_DIR}/cni-bin

cp ../../../_output/dockerized/bin/linux/${ARCH}/hyperkube ${TEMP_DIR}
cp ../../../${HYPERKUBE_BIN} ${TEMP_DIR}

chmod a+rx ${TEMP_DIR}/hyperkube

cd ${TEMP_DIR} && sed -i.back "s|ARCH|${QEMUARCH}|g" Dockerfile
Expand All @@ -71,8 +74,8 @@ ifeq ($(CACHEBUST),1)
cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile
endif

ifeq ($(ARCH),amd64)
# When building "normally" for amd64, remove the whole line, it has no part in the amd64 image
ifeq ($(ARCH),$(HOSTARCH))
# When building "normally", remove the whole line, it has no part in the image
cd ${TEMP_DIR} && ${SED_CMD} "/CROSS_BUILD_/d" Dockerfile
else
cd ${TEMP_DIR} && ${SED_CMD} "s/CROSS_BUILD_//g" Dockerfile
Expand Down