Skip to content

Commit

Permalink
Merge pull request #67462 from ixdy/automated-cherry-pick-of-#67026-#…
Browse files Browse the repository at this point in the history
…67222-#67283-#67365-upstream-release-1.10

Automatic merge from submit-queue.

release-1.10: update to debian-base 0.3.2, debian-iptables v10.1 and hyperkubebase 0.10.1

Cherry pick of #67026 #67222 #67283 #67365 on release-1.10.

#67026: Upgrade debian-base to 0.3.1 for CVEs
#67222: ensure qemu-ARCH-static binary is world readable and
#67283: Add missing tmpdir path to chmod
#67365: Update to debian-iptables v10.1 and hyperkube-base 0.10.1
  • Loading branch information
Kubernetes Submit Queue committed Aug 17, 2018
2 parents a36a7ec + ebccf77 commit ff529ab
Show file tree
Hide file tree
Showing 12 changed files with 39 additions and 56 deletions.
2 changes: 1 addition & 1 deletion build/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ readonly KUBE_CONTAINER_RSYNC_PORT=8730
#
# $1 - server architecture
kube::build::get_docker_wrapped_binaries() {
debian_iptables_version=v10
debian_iptables_version=v10.1
### If you change any of these lists, please also update DOCKERIZED_BINARIES
### in build/BUILD.
case $1 in
Expand Down
6 changes: 4 additions & 2 deletions build/debian-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ REGISTRY ?= staging-k8s.gcr.io
IMAGE ?= debian-base
BUILD_IMAGE ?= debian-build

TAG ?= 0.3
TAG ?= 0.3.2

TAR_FILE ?= rootfs.tar
ARCH?=amd64
Expand Down Expand Up @@ -57,9 +57,11 @@ ifeq ($(ARCH),amd64)
sed "/CROSS_BUILD_/d" $(TEMP_DIR)/Dockerfile.build > $(TEMP_DIR)/Dockerfile.build.tmp
else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/$(QEMUVERSION)/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR)
# Ensure we don't get surprised by umask settings
chmod 0755 $(TEMP_DIR)/qemu-$(QEMUARCH)-static
sed "s/CROSS_BUILD_//g" $(TEMP_DIR)/Dockerfile.build > $(TEMP_DIR)/Dockerfile.build.tmp
endif
mv $(TEMP_DIR)/Dockerfile.build.tmp $(TEMP_DIR)/Dockerfile.build
Expand Down
6 changes: 4 additions & 2 deletions build/debian-hyperkube-base/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@

REGISTRY?=staging-k8s.gcr.io
IMAGE?=debian-hyperkube-base
TAG=0.10
TAG=0.10.1
ARCH?=amd64
CACHEBUST?=1

BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.3
BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.3.2
CNI_VERSION=v0.6.0

TEMP_DIR:=$(shell mktemp -d)
Expand Down Expand Up @@ -51,8 +51,10 @@ endif
mkdir -p ${TEMP_DIR}/cni-bin/bin
tar -xz -C ${TEMP_DIR}/cni-bin/bin -f "cni-tars/${CNI_TARBALL}"

ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset
endif
docker build --pull -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR)
rm -rf $(TEMP_DIR)

Expand Down
4 changes: 0 additions & 4 deletions build/debian-iptables/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@

FROM BASEIMAGE

# If we're building for another architecture than amd64, the CROSS_BUILD_ placeholder is removed so e.g. CROSS_BUILD_COPY turns into COPY
# If we're building normally, for amd64, CROSS_BUILD lines are removed
CROSS_BUILD_COPY qemu-ARCH-static /usr/bin/

RUN clean-install \
conntrack \
ebtables \
Expand Down
31 changes: 5 additions & 26 deletions build/debian-iptables/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,40 +16,19 @@

REGISTRY?="staging-k8s.gcr.io"
IMAGE=debian-iptables
TAG=v10
TAG=v10.1
ARCH?=amd64
TEMP_DIR:=$(shell mktemp -d)
QEMUVERSION=v2.9.1

ifeq ($(ARCH),arm)
QEMUARCH=arm
endif
ifeq ($(ARCH),arm64)
QEMUARCH=aarch64
endif
ifeq ($(ARCH),ppc64le)
QEMUARCH=ppc64le
endif
ifeq ($(ARCH),s390x)
QEMUARCH=s390x
endif

BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.3
BASEIMAGE=k8s.gcr.io/debian-base-$(ARCH):0.3.2

build:
cp ./* $(TEMP_DIR)
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
cd $(TEMP_DIR) && sed -i "s|ARCH|$(QEMUARCH)|g" Dockerfile

ifeq ($(ARCH),amd64)
# When building "normally" for amd64, remove the whole line, it has no part in the amd64 image
cd $(TEMP_DIR) && sed -i "/CROSS_BUILD_/d" Dockerfile
else
# When cross-building, only the placeholder "CROSS_BUILD_" should be removed
# Register /usr/bin/qemu-ARCH-static as the handler for ARM binaries in the kernel

ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/$(QEMUVERSION)/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR)
cd $(TEMP_DIR) && sed -i "s/CROSS_BUILD_//g" Dockerfile
endif

docker build --pull -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR)
Expand Down
8 changes: 4 additions & 4 deletions build/root/WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -59,18 +59,18 @@ http_file(

docker_pull(
name = "debian-iptables-amd64",
digest = "sha256:fb18678f8203ca1bd2fad2671e3ebd80cb408a1baae423d4ad39c05f4caac4e1",
digest = "sha256:58e53e477d204fe32f761ec2718b792f653063d4192ae89efc79e4b6a8dbba91",
registry = "k8s.gcr.io",
repository = "debian-iptables-amd64",
tag = "v10", # ignored, but kept here for documentation
tag = "v10.1", # ignored, but kept here for documentation
)

docker_pull(
name = "debian-hyperkube-base-amd64",
digest = "sha256:cc782ed16599000ca4c85d47ec6264753747ae1e77520894dca84b104a7621e2",
digest = "sha256:1c83ca9c8ac4a06e4585802edf8a1cd954011152409116e9c801f4736b97b956",
registry = "k8s.gcr.io",
repository = "debian-hyperkube-base-amd64",
tag = "0.10", # ignored, but kept here for documentation
tag = "0.10.1", # ignored, but kept here for documentation
)

docker_pull(
Expand Down
4 changes: 3 additions & 1 deletion cluster/images/hyperkube/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ARCH?=amd64
OUT_DIR?=_output
HYPERKUBE_BIN?=$(OUT_DIR)/dockerized/bin/linux/$(ARCH)/hyperkube

BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.10
BASEIMAGE=k8s.gcr.io/debian-hyperkube-base-$(ARCH):0.10.1
TEMP_DIR:=$(shell mktemp -d -t hyperkubeXXXXXX)

all: build
Expand All @@ -39,8 +39,10 @@ endif

cd ${TEMP_DIR} && sed -i.back "s|BASEIMAGE|${BASEIMAGE}|g" Dockerfile

ifneq ($(ARCH),amd64)
# Register /usr/bin/qemu-ARCH-static as the handler for non-x86 binaries in the kernel
docker run --rm --privileged multiarch/qemu-user-static:register --reset
endif
docker build --pull -t ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${TEMP_DIR}
rm -rf "${TEMP_DIR}"

Expand Down
2 changes: 2 additions & 0 deletions test/images/image-util.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ build() {
# Register qemu-*-static for all supported processors except the current one
docker run --rm --privileged multiarch/qemu-user-static:register --reset
curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/${QEMUVERSION}/x86_64_qemu-${QEMUARCHS[$arch]}-static.tar.gz | tar -xz -C ${temp_dir}
# Ensure we don't get surprised by umask settings
chmod 0755 "${temp_dir}/qemu-${QEMUARCHS[$arch]}-static"
sed -i "s/CROSS_BUILD_//g" Dockerfile
fi
fi
Expand Down
8 changes: 4 additions & 4 deletions test/images/pets/peer-finder/BASEIMAGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amd64=k8s.gcr.io/debian-base-amd64:0.3
arm=k8s.gcr.io/debian-base-arm:0.3
arm64=k8s.gcr.io/debian-base-arm64:0.3
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3
amd64=k8s.gcr.io/debian-base-amd64:0.3.2
arm=k8s.gcr.io/debian-base-arm:0.3.2
arm64=k8s.gcr.io/debian-base-arm64:0.3.2
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3.2
8 changes: 4 additions & 4 deletions test/images/pets/redis-installer/BASEIMAGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amd64=k8s.gcr.io/debian-base-amd64:0.3
arm=k8s.gcr.io/debian-base-arm:0.3
arm64=k8s.gcr.io/debian-base-arm64:0.3
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3
amd64=k8s.gcr.io/debian-base-amd64:0.3.2
arm=k8s.gcr.io/debian-base-arm:0.3.2
arm64=k8s.gcr.io/debian-base-arm64:0.3.2
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3.2
8 changes: 4 additions & 4 deletions test/images/pets/zookeeper-installer/BASEIMAGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amd64=k8s.gcr.io/debian-base-amd64:0.3
arm=k8s.gcr.io/debian-base-arm:0.3
arm64=k8s.gcr.io/debian-base-arm64:0.3
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3
amd64=k8s.gcr.io/debian-base-amd64:0.3.2
arm=k8s.gcr.io/debian-base-arm:0.3.2
arm64=k8s.gcr.io/debian-base-arm64:0.3.2
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3.2
8 changes: 4 additions & 4 deletions test/images/resource-consumer/BASEIMAGE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
amd64=k8s.gcr.io/debian-base-amd64:0.3
arm=k8s.gcr.io/debian-base-arm:0.3
arm64=k8s.gcr.io/debian-base-arm64:0.3
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3
amd64=k8s.gcr.io/debian-base-amd64:0.3.2
arm=k8s.gcr.io/debian-base-arm:0.3.2
arm64=k8s.gcr.io/debian-base-arm64:0.3.2
ppc64le=k8s.gcr.io/debian-base-ppc64le:0.3.2

0 comments on commit ff529ab

Please sign in to comment.