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-06-23 22:05:07 +00:00
|
|
|
.DEFAULT_GOAL:=build
|
2020-02-15 18:16:23 +00:00
|
|
|
|
|
|
|
# set default shell
|
2020-06-23 22:05:07 +00:00
|
|
|
SHELL=/bin/bash
|
2020-02-15 18:16:23 +00:00
|
|
|
|
2017-01-31 18:19:58 +00:00
|
|
|
# 0.0.0 shouldn't clobber any released builds
|
2020-06-23 22:05:07 +00:00
|
|
|
TAG ?= 0.104
|
|
|
|
REGISTRY ?= gcr.io/k8s-staging-ingress-nginx
|
2017-04-11 13:49:15 +00:00
|
|
|
|
2020-05-28 18:09:44 +00:00
|
|
|
IMAGE = $(REGISTRY)/nginx
|
2017-05-22 12:14:18 +00:00
|
|
|
|
2020-06-23 22:05:07 +00:00
|
|
|
# required to enable buildx
|
|
|
|
export DOCKER_CLI_EXPERIMENTAL=enabled
|
|
|
|
|
|
|
|
# build with buildx
|
|
|
|
PLATFORMS?=linux/amd64,linux/arm,linux/arm64,linux/s390x
|
|
|
|
OUTPUT=
|
|
|
|
PROGRESS=plain
|
|
|
|
build: ensure-buildx
|
2020-05-30 20:00:20 +00:00
|
|
|
docker buildx build \
|
2020-06-23 22:05:07 +00:00
|
|
|
--platform=${PLATFORMS} $(OUTPUT) \
|
|
|
|
--progress=$(PROGRESS) \
|
2020-05-26 16:11:55 +00:00
|
|
|
--pull \
|
2020-01-14 16:57:44 +00:00
|
|
|
--tag $(IMAGE):$(TAG) rootfs
|
|
|
|
|
2020-06-23 22:05:07 +00:00
|
|
|
# push the cross built image
|
|
|
|
push: OUTPUT=--push
|
|
|
|
push: build
|
|
|
|
|
|
|
|
# enable buildx
|
|
|
|
ensure-buildx:
|
|
|
|
./../../hack/init-buildx.sh
|
|
|
|
|
|
|
|
.PHONY: build push ensure-buildx
|