mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-25 04:33:26 +00:00
Manifest for etcd image
This commit is contained in:
parent
76518f154b
commit
934d379aea
@ -40,13 +40,19 @@ REVISION?=0
|
|||||||
IMAGE_TAG=$(LATEST_ETCD_VERSION)-$(REVISION)
|
IMAGE_TAG=$(LATEST_ETCD_VERSION)-$(REVISION)
|
||||||
|
|
||||||
ARCH?=amd64
|
ARCH?=amd64
|
||||||
|
ALL_ARCH = amd64 arm arm64 ppc64le s390x
|
||||||
# Image should be pulled from k8s.gcr.io, which will auto-detect
|
# Image should be pulled from k8s.gcr.io, which will auto-detect
|
||||||
# region (us, eu, asia, ...) and pull from the closest.
|
# region (us, eu, asia, ...) and pull from the closest.
|
||||||
REGISTRY?=k8s.gcr.io
|
REGISTRY?=k8s.gcr.io
|
||||||
# Images should be pushed to staging-k8s.gcr.io.
|
# Images should be pushed to staging-k8s.gcr.io.
|
||||||
PUSH_REGISTRY?=staging-k8s.gcr.io
|
PUSH_REGISTRY?=staging-k8s.gcr.io
|
||||||
|
|
||||||
|
MANIFEST_IMAGE := $(PUSH_REGISTRY)/etcd
|
||||||
|
|
||||||
|
# This option is for running docker manifest command
|
||||||
|
export DOCKER_CLI_EXPERIMENTAL := enabled
|
||||||
# golang version should match the golang version from https://github.com/coreos/etcd/releases for the current ETCD_VERSION.
|
# golang version should match the golang version from https://github.com/coreos/etcd/releases for the current ETCD_VERSION.
|
||||||
GOLANG_VERSION?=1.8.7
|
GOLANG_VERSION?=1.11
|
||||||
GOARM=7
|
GOARM=7
|
||||||
TEMP_DIR:=$(shell mktemp -d)
|
TEMP_DIR:=$(shell mktemp -d)
|
||||||
|
|
||||||
@ -118,14 +124,25 @@ endif
|
|||||||
docker build --pull -t $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(TEMP_DIR)
|
docker build --pull -t $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(TEMP_DIR)
|
||||||
|
|
||||||
push: build
|
push: build
|
||||||
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(PUSH_REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG)
|
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(MANIFEST_IMAGE)-$(ARCH):$(IMAGE_TAG)
|
||||||
docker push $(PUSH_REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG)
|
docker push $(MANIFEST_IMAGE)-$(ARCH):$(IMAGE_TAG)
|
||||||
|
|
||||||
ifeq ($(ARCH),amd64)
|
sub-build-%:
|
||||||
# Backward compatibility. TODO: deprecate this image tag
|
$(MAKE) ARCH=$* build
|
||||||
docker tag $(REGISTRY)/etcd-$(ARCH):$(IMAGE_TAG) $(PUSH_REGISTRY)/etcd:$(IMAGE_TAG)
|
|
||||||
docker push $(PUSH_REGISTRY)/etcd:$(IMAGE_TAG)
|
all-build: $(addprefix sub-build-,$(ALL_ARCH))
|
||||||
endif
|
|
||||||
|
sub-push-image-%:
|
||||||
|
$(MAKE) ARCH=$* push
|
||||||
|
|
||||||
|
all-push-images: $(addprefix sub-push-image-,$(ALL_ARCH))
|
||||||
|
|
||||||
|
all-push: all-push-images push-manifest
|
||||||
|
|
||||||
|
push-manifest:
|
||||||
|
docker manifest create --amend $(MANIFEST_IMAGE):$(IMAGE_TAG) $(shell echo $(ALL_ARCH) | sed -e "s~[^ ]*~$(MANIFEST_IMAGE)\-&:$(IMAGE_TAG)~g")
|
||||||
|
@for arch in $(ALL_ARCH); do docker manifest annotate --arch $${arch} ${MANIFEST_IMAGE}:${IMAGE_TAG} ${MANIFEST_IMAGE}-$${arch}:${IMAGE_TAG}; done
|
||||||
|
docker manifest push ${MANIFEST_IMAGE}:${IMAGE_TAG}
|
||||||
|
|
||||||
unit-test:
|
unit-test:
|
||||||
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) golang:$(GOLANG_VERSION) \
|
docker run --interactive -v $(shell pwd)/../../../:/go/src/k8s.io/kubernetes -e GOARCH=$(ARCH) golang:$(GOLANG_VERSION) \
|
||||||
@ -146,5 +163,5 @@ integration-test:
|
|||||||
|
|
||||||
integration-build-test: build-integration-test-image integration-test
|
integration-build-test: build-integration-test-image integration-test
|
||||||
test: unit-test integration-build-test
|
test: unit-test integration-build-test
|
||||||
all: build test
|
all: all-build test
|
||||||
.PHONY: build push unit-test build-integration-test-image integration-test integration-build-test test
|
.PHONY: build push push-manifest all-push all-push-images all-build unit-test build-integration-test-image integration-test integration-build-test test
|
||||||
|
@ -62,22 +62,14 @@ $ make build test
|
|||||||
Last, build and push the docker images for all supported architectures.
|
Last, build and push the docker images for all supported architectures.
|
||||||
|
|
||||||
```console
|
```console
|
||||||
# Build for linux/amd64 (default)
|
# Build images for all the architecture and push the manifest image as well
|
||||||
$ make push ARCH=amd64
|
$ make all-push
|
||||||
# ---> staging-k8s.gcr.io/etcd-amd64:TAG
|
|
||||||
# ---> staging-k8s.gcr.io/etcd:TAG
|
|
||||||
|
|
||||||
$ make push ARCH=arm
|
# Build images for all the architecture
|
||||||
# ---> staging-k8s.gcr.io/etcd-arm:TAG
|
$ make all-build
|
||||||
|
|
||||||
$ make push ARCH=arm64
|
# Build image for target architecture(default=amd64)
|
||||||
# ---> staging-k8s.gcr.io/etcd-arm64:TAG
|
$ make build ARCH=ppc64le
|
||||||
|
|
||||||
$ make push ARCH=ppc64le
|
|
||||||
# ---> staging-k8s.gcr.io/etcd-ppc64le:TAG
|
|
||||||
|
|
||||||
$ make push ARCH=s390x
|
|
||||||
# ---> staging-k8s.gcr.io/etcd-s390x:TAG
|
|
||||||
```
|
```
|
||||||
|
|
||||||
If you don't want to push the images, run `make` or `make build` instead
|
If you don't want to push the images, run `make` or `make build` instead
|
||||||
|
Loading…
Reference in New Issue
Block a user