Skip to content

Commit 909e7ff

Browse files
authored
Merge pull request #164 from krunalhinguu/bump-ingress-nginx-v1.12.1
Bump ingress nginx v1.12.1
2 parents a9a747f + c4bb4b5 commit 909e7ff

2 files changed

Lines changed: 69 additions & 5 deletions

File tree

Makefile

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -232,10 +232,9 @@ misspell: ## Check for spelling errors.
232232
run-ingress-controller: ## Run the ingress controller locally using a kubectl proxy connection.
233233
@build/run-ingress-controller.sh
234234

235-
.PHONY: builder
236-
builder:
237-
docker buildx create --name $(BUILDER) --bootstrap --use || :
238-
docker buildx inspect $(BUILDER)
235+
.PHONY: ensure-buildx
236+
ensure-buildx:
237+
./hack/init-buildx.sh
239238

240239
.PHONY: show-version
241240
show-version:
@@ -246,7 +245,7 @@ PLATFORMS ?= amd64 arm arm64
246245
BUILDX_PLATFORMS ?= linux/amd64,linux/arm,linux/arm64
247246

248247
.PHONY: release # Build a multi-arch docker image
249-
release: builder clean
248+
release: ensure-buildx clean
250249
# Rancher CI: the build has been done in the build step in the scripts/ci
251250
# echo "Building binaries..."
252251
# $(foreach PLATFORM,$(PLATFORMS), echo -n "$(PLATFORM)..."; ARCH=$(PLATFORM) make build;)

hack/init-buildx.sh

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
#!/usr/bin/env bash
2+
3+
# Copyright 2020 The Kubernetes Authors.
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
17+
if [ -n "$DEBUG" ]; then
18+
set -x
19+
fi
20+
21+
set -o errexit
22+
set -o nounset
23+
set -o pipefail
24+
25+
export DOCKER_CLI_EXPERIMENTAL=enabled
26+
27+
if ! docker buildx 2>&1 >/dev/null; then
28+
echo "buildx not available. Docker 19.03 or higher is required with experimental features enabled"
29+
exit 1
30+
fi
31+
32+
# Ensure qemu is in binfmt_misc
33+
# Docker desktop already has these in versions recent enough to have buildx
34+
# We only need to do this setup on linux hosts
35+
if [ "$(uname)" == 'Linux' ]; then
36+
# NOTE: this is pinned to a digest for a reason!
37+
# Note2 (@rikatz) - Removing the pin, as apparently it's breaking new alpine builds
38+
# docker run --rm --privileged multiarch/qemu-user-static@sha256:28ebe2e48220ae8fd5d04bb2c847293b24d7fbfad84f0b970246e0a4efd48ad6 --reset -p yes
39+
docker run --rm --privileged multiarch/qemu-user-static --reset -p yes
40+
fi
41+
42+
# We can skip setup if the current builder already has multi-arch
43+
# AND if it isn't the docker driver, which doesn't work
44+
current_builder="$(docker buildx inspect)"
45+
# linux/amd64, linux/arm, linux/arm64
46+
if ! grep -q "^Driver: docker$" <<<"${current_builder}" && \
47+
grep -q "linux/amd64" <<<"${current_builder}" && \
48+
grep -q "linux/arm" <<<"${current_builder}" && \
49+
grep -q "linux/arm64" <<<"${current_builder}"; then
50+
exit 0
51+
fi
52+
53+
# Ensure qemu is in binfmt_misc
54+
# Docker desktop already has these in versions recent enough to have buildx
55+
# We only need to do this setup on linux hosts
56+
if [ "$(uname)" == 'Linux' ]; then
57+
# NOTE: this is pinned to a digest for a reason!
58+
# https://github.com/docker/buildx/issues/542#issuecomment-778835576
59+
docker run --rm --privileged tonistiigi/binfmt --uninstall qemu-aarch64 && docker run --rm --privileged tonistiigi/binfmt --install arm64
60+
docker run --rm --privileged tonistiigi/binfmt
61+
fi
62+
63+
# Ensure we use a builder that can leverage it (the default on linux will not)
64+
docker buildx rm ingress-nginx || true
65+
docker buildx create --use --name=ingress-nginx

0 commit comments

Comments
 (0)