diff --git a/cluster/images/hyperkube/Dockerfile b/cluster/images/hyperkube/Dockerfile index bde5343c1471d..3346f7a61f3e4 100644 --- a/cluster/images/hyperkube/Dockerfile +++ b/cluster/images/hyperkube/Dockerfile @@ -14,6 +14,9 @@ FROM BASEIMAGE +# Copy CNI binaries +COPY cni-bin/bin/ /opt/cni/bin + # Create symlinks for each hyperkube server # Also create symlinks to /usr/local/bin/ where the server image binaries live, so the hyperkube image may be # used instead of gcr.io/google_containers/kube-* without any modifications. diff --git a/cluster/images/hyperkube/Makefile b/cluster/images/hyperkube/Makefile index 53b7a635e2049..fd7fc40d38ac7 100644 --- a/cluster/images/hyperkube/Makefile +++ b/cluster/images/hyperkube/Makefile @@ -20,13 +20,15 @@ REGISTRY?=gcr.io/google-containers ARCH?=amd64 HYPERKUBE_BIN?=_output/dockerized/bin/linux/$(ARCH)/hyperkube +CALICO_RELEASE=v1.11.0 +CNI_RELEASE=v0.6.0 BASEIMAGE=gcr.io/google-containers/debian-hyperkube-base-$(ARCH):0.4.1 TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX) all: build -build: +build: cni ifndef VERSION $(error VERSION is undefined) @@ -51,4 +53,11 @@ ifeq ($(ARCH),amd64) gcloud docker -- push ${REGISTRY}/hyperkube:${VERSION} endif -.PHONY: build push all +cni: + mkdir -p ${TEMP_DIR}/cni-bin/bin + curl -sSL --retry 5 https://github.com/containernetworking/cni/releases/download/${CNI_RELEASE}/cni-${ARCH}-${CNI_RELEASE}.tgz | tar -xz -C ${TEMP_DIR}/cni-bin/bin + curl -sSL --retry 5 https://github.com/containernetworking/plugins/releases/download/${CNI_RELEASE}/cni-plugins-${ARCH}-${CNI_RELEASE}.tgz | tar -xz -C ${TEMP_DIR}/cni-bin/bin + curl -sSL --retry 5 -o ${TEMP_DIR}/cni-bin/bin/calico https://github.com/projectcalico/calico-cni/releases/download/${CALICO_RELEASE}/calico + chmod +x ${TEMP_DIR}/cni-bin/bin/calico + +.PHONY: build push all cni