mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-20 17:38:50 +00:00
Merge pull request #19061 from fgrzadkowski/release_docker
Auto commit by PR queue bot
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
# build the hyperkube image.
|
||||
# Build the hyperkube image.
|
||||
#
|
||||
# Usage:
|
||||
# VERSION=v1.1.2 [REGISTRY="gcr.io/google_containers"] make build
|
||||
|
||||
VERSION=v1.1.2
|
||||
REGISTRY?="gcr.io/google_containers"
|
||||
ARCH=amd64
|
||||
BASEIMAGE=debian:jessie
|
||||
TEMP_DIR:=$(shell mktemp -d)
|
||||
@@ -13,6 +16,9 @@ TEMP_DIR:=$(shell mktemp -d)
|
||||
all: build
|
||||
|
||||
build:
|
||||
ifndef VERSION
|
||||
$(error VERSION is undefined)
|
||||
endif
|
||||
cp ./* ${TEMP_DIR}
|
||||
cp ../../saltbase/salt/helpers/safe_format_and_mount ${TEMP_DIR}
|
||||
cp ../../saltbase/salt/generate-cert/make-ca-cert.sh ${TEMP_DIR}
|
||||
@@ -20,19 +26,16 @@ build:
|
||||
cd ${TEMP_DIR} && sed -i "s/VERSION/${VERSION}/g" master-multi.json master.json kube-proxy.json
|
||||
cd ${TEMP_DIR} && sed -i "s/ARCH/${ARCH}/g" master-multi.json master.json kube-proxy.json
|
||||
cd ${TEMP_DIR} && sed -i "s/BASEIMAGE/${BASEIMAGE}/g" Dockerfile
|
||||
docker build -t gcr.io/google_containers/hyperkube-${ARCH}:${VERSION} ${TEMP_DIR}
|
||||
docker build -t ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${TEMP_DIR}
|
||||
# Backward compatability. TODO: deprecate this image tag
|
||||
ifeq ($(ARCH),amd64)
|
||||
docker tag -f gcr.io/google_containers/hyperkube-${ARCH}:${VERSION} gcr.io/google_containers/hyperkube:${VERSION}
|
||||
docker tag -f ${REGISTRY}/hyperkube-${ARCH}:${VERSION} ${REGISTRY}/hyperkube:${VERSION}
|
||||
endif
|
||||
|
||||
push: build
|
||||
gcloud docker push gcr.io/google_containers/hyperkube-${ARCH}:${VERSION}
|
||||
gcloud docker push ${REGISTRY}/hyperkube-${ARCH}:${VERSION}
|
||||
ifeq ($(ARCH),amd64)
|
||||
gcloud docker push gcr.io/google_containers/hyperkube:${VERSION}
|
||||
gcloud docker push ${REGISTRY}/hyperkube:${VERSION}
|
||||
endif
|
||||
|
||||
clean:
|
||||
rm -f safe_format_and_mount make-ca-cert.sh hyperkube
|
||||
|
||||
.PHONY: all
|
||||
|
Reference in New Issue
Block a user