2017-04-11 13:49:15 +00:00
|
|
|
# Copyright 2017 The Kubernetes Authors. All rights reserved.
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
|
2017-01-31 18:19:58 +00:00
|
|
|
# 0.0.0 shouldn't clobber any released builds
|
2020-01-13 20:44:27 +00:00
|
|
|
TAG ?= 0.96
|
2017-10-24 20:16:24 +00:00
|
|
|
REGISTRY ?= quay.io/kubernetes-ingress-controller
|
2017-04-11 13:49:15 +00:00
|
|
|
ARCH ?= $(shell go env GOARCH)
|
2018-04-24 19:24:38 +00:00
|
|
|
DOCKER ?= docker
|
2017-10-24 03:30:20 +00:00
|
|
|
|
2019-06-26 12:12:00 +00:00
|
|
|
ALL_ARCH = amd64 arm arm64
|
2017-04-11 13:49:15 +00:00
|
|
|
|
2017-11-12 03:34:40 +00:00
|
|
|
IMGNAME = nginx
|
2017-04-11 13:49:15 +00:00
|
|
|
IMAGE = $(REGISTRY)/$(IMGNAME)
|
|
|
|
MULTI_ARCH_IMG = $(IMAGE)-$(ARCH)
|
|
|
|
|
2017-10-26 02:37:37 +00:00
|
|
|
all: all-container
|
|
|
|
|
2017-10-24 03:30:20 +00:00
|
|
|
image-info:
|
|
|
|
echo -n '{"image":"$(IMAGE)","tag":"$(TAG)"}'
|
|
|
|
|
2017-05-22 12:14:18 +00:00
|
|
|
sub-container-%:
|
|
|
|
$(MAKE) ARCH=$* container
|
|
|
|
|
|
|
|
sub-push-%:
|
|
|
|
$(MAKE) ARCH=$* push
|
|
|
|
|
|
|
|
all-container: $(addprefix sub-container-,$(ALL_ARCH))
|
|
|
|
|
|
|
|
all-push: $(addprefix sub-push-,$(ALL_ARCH))
|
|
|
|
|
|
|
|
container: .container-$(ARCH)
|
|
|
|
.container-$(ARCH):
|
2020-01-13 23:34:24 +00:00
|
|
|
$(DOCKER) buildx build \
|
|
|
|
--no-cache \
|
|
|
|
--progress plain \
|
|
|
|
--platform linux/$(ARCH) \
|
|
|
|
-t $(MULTI_ARCH_IMG):$(TAG) rootfs
|
2017-04-11 13:49:15 +00:00
|
|
|
|
|
|
|
ifeq ($(ARCH), amd64)
|
|
|
|
# This is for to maintain the backward compatibility
|
2017-10-24 03:30:20 +00:00
|
|
|
$(DOCKER) tag $(MULTI_ARCH_IMG):$(TAG) $(IMAGE):$(TAG)
|
2017-04-11 13:49:15 +00:00
|
|
|
endif
|
2017-01-31 18:19:58 +00:00
|
|
|
|
2017-05-22 12:14:18 +00:00
|
|
|
push: .push-$(ARCH)
|
|
|
|
.push-$(ARCH): .container-$(ARCH)
|
2017-10-24 03:30:20 +00:00
|
|
|
$(DOCKER) push $(MULTI_ARCH_IMG):$(TAG)
|
2017-04-11 13:49:15 +00:00
|
|
|
ifeq ($(ARCH), amd64)
|
2017-10-24 03:30:20 +00:00
|
|
|
$(DOCKER) push $(IMAGE):$(TAG)
|
2017-04-11 13:49:15 +00:00
|
|
|
endif
|
2017-01-31 18:19:58 +00:00
|
|
|
|
2017-05-22 12:14:18 +00:00
|
|
|
clean: $(addprefix sub-clean-,$(ALL_ARCH))
|
|
|
|
sub-clean-%:
|
2017-10-24 03:30:20 +00:00
|
|
|
$(DOCKER) rmi -f $(IMAGE)-$*:$(TAG) || true
|
|
|
|
|
|
|
|
release: all-container all-push
|
|
|
|
echo "done"
|