Rebase hyperkube image on debian-hyperkube-base, based on debian-base.

This commit is contained in:
Jeff Grafton
2017-06-30 14:19:22 -07:00
parent 6fbc554c6b
commit 66b9ae7cd8
6 changed files with 135 additions and 84 deletions

View File

@@ -0,0 +1 @@
/cni-tars

View File

@@ -0,0 +1,37 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM BASEIMAGE
# The samba-common, cifs-utils, and nfs-common packages depend on
# ucf, which itself depends on /bin/bash existing.
# It doesn't seem to actually need bash, however.
RUN ln -s /bin/sh /bin/bash
RUN echo CACHEBUST>/dev/null && clean-install \
iptables \
ebtables \
ethtool \
ca-certificates \
conntrack \
util-linux \
socat \
git \
jq \
nfs-common \
glusterfs-client \
cifs-utils \
ceph-common
COPY cni-bin/bin /opt/cni/bin

View File

@@ -0,0 +1,58 @@
# Copyright 2017 The Kubernetes Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
# Build the hyperkube base image. This image is used to build the hyperkube image.
#
# Usage:
# [ARCH=amd64] [REGISTRY="gcr.io/google-containers"] make (build|push)
REGISTRY?=gcr.io/google-containers
IMAGE?=debian-hyperkube-base
TAG=0.1
ARCH?=amd64
CACHEBUST?=1
BASEIMAGE=gcr.io/google-containers/debian-base-$(ARCH):0.1
CNI_RELEASE=0799f5732f2a11b329d9e3d51b9c8f2e3759f2ff
TEMP_DIR:=$(shell mktemp -d)
CNI_TARBALL=cni-$(ARCH)-$(CNI_RELEASE).tar.gz
.PHONY: all build push clean
all: push
cni-tars/$(CNI_TARBALL):
mkdir -p cni-tars/
cd cni-tars/ && curl -sSLO --retry 5 https://storage.googleapis.com/kubernetes-release/network-plugins/${CNI_TARBALL}
clean:
rm -rf cni-tars/
build: cni-tars/$(CNI_TARBALL)
cp Dockerfile $(TEMP_DIR)
cd $(TEMP_DIR) && sed -i "s|BASEIMAGE|$(BASEIMAGE)|g" Dockerfile
ifeq ($(CACHEBUST),1)
cd ${TEMP_DIR} && sed -i.back "s|CACHEBUST|$(shell uuidgen)|g" Dockerfile
endif
mkdir -p ${TEMP_DIR}/cni-bin
tar -xz -C ${TEMP_DIR}/cni-bin -f "cni-tars/${CNI_TARBALL}"
docker build --pull -t $(REGISTRY)/$(IMAGE)-$(ARCH):$(TAG) $(TEMP_DIR)
rm -rf $(TEMP_DIR)
push: build
gcloud docker -- push $(REGISTRY)/$(IMAGE)-$(ARCH):$(TAG)

View File

@@ -0,0 +1,33 @@
### debian-hyperkube-base
Serves as the base image for `gcr.io/google-containers/hyperkube-${ARCH}`
images.
This image is compiled for multiple architectures.
#### How to release
If you're editing the Dockerfile or some other thing, please bump the `TAG` in the Makefile.
```console
# Build for linux/amd64 (default)
$ make push ARCH=amd64
# ---> gcr.io/google-containers/debian-hyperkube-base-amd64:TAG
$ make push ARCH=arm
# ---> gcr.io/google-containers/debian-hyperkube-base-arm:TAG
$ make push ARCH=arm64
# ---> gcr.io/google-containers/debian-hyperkube-base-arm64:TAG
$ make push ARCH=ppc64le
# ---> gcr.io/google-containers/debian-hyperkube-base-ppc64le:TAG
$ make push ARCH=s390x
# ---> gcr.io/google-containers/debian-hyperkube-base-s390x:TAG
```
If you don't want to push the images, run `make build` instead
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/build/debian-hyperkube-base/README.md?pixel)]()