Commit d0ee6bb1 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #47776 from jianzhangbjz/build-hyperkube-ppc64le

Automatic merge from submit-queue Parameterize the binary path and host arch for the hyperkube image As the [cluster/images/hyperkube/README.md](https://github.com/kubernetes/kubernetes/tree/master/cluster/images/hyperkube) shows, I run the command: `make build VERSION=test ARCH=ppc64le`, but got the below errors, so this PR will fix it. ``` ARCH=ppc64le cp -r ./* /tmp/hyperkubeTFbYrI mkdir -p /tmp/hyperkubeTFbYrI/cni-bin cp ../../../_output/dockerized/bin/linux/ppc64le/hyperkube /tmp/hyperkubeTFbYrI cp: cannot stat '../../../_output/dockerized/bin/linux/ppc64le/hyperkube': No such file or directory Makefile:62: recipe for target 'build' failed make: *** [build] Error 1 ```
parents 714f97d7 5660043c
...@@ -23,6 +23,8 @@ TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX) ...@@ -23,6 +23,8 @@ TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX)
CNI_RELEASE=0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff CNI_RELEASE=0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff
CACHEBUST?=1 CACHEBUST?=1
QEMUVERSION=v2.7.0 QEMUVERSION=v2.7.0
HYPERKUBE_BIN?=_output/dockerized/bin/linux/${ARCH}/hyperkube
HOSTARCH?=amd64
UNAME_S:=$(shell uname -s) UNAME_S:=$(shell uname -s)
ifeq ($(UNAME_S),Darwin) ifeq ($(UNAME_S),Darwin)
...@@ -62,7 +64,8 @@ endif ...@@ -62,7 +64,8 @@ endif
cp -r ./* ${TEMP_DIR} cp -r ./* ${TEMP_DIR}
mkdir -p ${TEMP_DIR}/cni-bin 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 chmod a+rx ${TEMP_DIR}/hyperkube
cd ${TEMP_DIR} && sed -i.back "s|ARCH|${QEMUARCH}|g" Dockerfile cd ${TEMP_DIR} && sed -i.back "s|ARCH|${QEMUARCH}|g" Dockerfile
...@@ -71,8 +74,8 @@ ifeq ($(CACHEBUST),1) ...@@ -71,8 +74,8 @@ ifeq ($(CACHEBUST),1)
cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile
endif endif
ifeq ($(ARCH),amd64) ifeq ($(ARCH),$(HOSTARCH))
# When building "normally" for amd64, remove the whole line, it has no part in the amd64 image # When building "normally", remove the whole line, it has no part in the image
cd ${TEMP_DIR} && ${SED_CMD} "/CROSS_BUILD_/d" Dockerfile cd ${TEMP_DIR} && ${SED_CMD} "/CROSS_BUILD_/d" Dockerfile
else else
cd ${TEMP_DIR} && ${SED_CMD} "s/CROSS_BUILD_//g" Dockerfile cd ${TEMP_DIR} && ${SED_CMD} "s/CROSS_BUILD_//g" Dockerfile
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment