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.
|
|
|
|
|
2020-02-15 18:16:23 +00:00
|
|
|
.DEFAULT_GOAL:=container
|
|
|
|
|
|
|
|
# set default shell
|
|
|
|
SHELL=/bin/bash -o pipefail
|
|
|
|
|
2017-01-31 18:19:58 +00:00
|
|
|
# 0.0.0 shouldn't clobber any released builds
|
2020-05-26 16:11:55 +00:00
|
|
|
TAG ?= 0.102
|
2017-10-24 20:16:24 +00:00
|
|
|
REGISTRY ?= quay.io/kubernetes-ingress-controller
|
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)
|
2017-05-22 12:14:18 +00:00
|
|
|
|
2020-01-14 16:57:44 +00:00
|
|
|
PLATFORMS = amd64 arm arm64
|
2017-05-22 12:14:18 +00:00
|
|
|
|
2020-01-14 16:57:44 +00:00
|
|
|
EMPTY :=
|
|
|
|
SPACE := $(EMPTY) $(EMPTY)
|
|
|
|
COMMA := ,
|
2017-05-22 12:14:18 +00:00
|
|
|
|
2020-01-26 13:07:55 +00:00
|
|
|
.PHONY: container
|
2020-01-14 16:57:44 +00:00
|
|
|
container:
|
|
|
|
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build \
|
2020-05-26 16:11:55 +00:00
|
|
|
--pull \
|
2020-01-13 23:34:24 +00:00
|
|
|
--progress plain \
|
2020-01-14 16:57:44 +00:00
|
|
|
--platform $(subst $(SPACE),$(COMMA),$(PLATFORMS)) \
|
|
|
|
--tag $(IMAGE):$(TAG) rootfs
|
|
|
|
|
|
|
|
# https://github.com/docker/buildx/issues/59
|
|
|
|
$(foreach PLATFORM,$(PLATFORMS), \
|
2020-02-15 18:16:23 +00:00
|
|
|
DOCKER_CLI_EXPERIMENTAL=enabled docker buildx build \
|
|
|
|
--load \
|
|
|
|
--progress plain \
|
|
|
|
--platform $(PLATFORM) \
|
|
|
|
--tag $(IMAGE)-$(PLATFORM):$(TAG) rootfs;)
|
2017-04-11 13:49:15 +00:00
|
|
|
|
2020-01-26 13:07:55 +00:00
|
|
|
.PHONY: push
|
2020-01-14 16:57:44 +00:00
|
|
|
push: container
|
|
|
|
$(foreach PLATFORM,$(PLATFORMS), \
|
|
|
|
docker push $(IMAGE)-$(PLATFORM):$(TAG);)
|
|
|
|
|
2020-01-26 13:07:55 +00:00
|
|
|
.PHONY: release
|
2020-01-14 16:57:44 +00:00
|
|
|
release: push
|
2017-10-24 03:30:20 +00:00
|
|
|
echo "done"
|
2020-01-26 13:07:55 +00:00
|
|
|
|
|
|
|
.PHONY: init-docker-buildx
|
|
|
|
init-docker-buildx:
|
2020-02-04 14:49:07 +00:00
|
|
|
ifneq ($(shell docker buildx 2>&1 >/dev/null; echo $?),)
|
|
|
|
$(error "buildx not vailable. Docker 19.03 or higher is required")
|
|
|
|
endif
|
2020-01-26 13:07:55 +00:00
|
|
|
docker run --rm --privileged docker/binfmt:66f9012c56a8316f9244ffd7622d7c21c1f6f28d
|
|
|
|
docker buildx create --name ingress-nginx --use || true
|
|
|
|
docker buildx inspect --bootstrap
|