diff --git a/Makefile b/Makefile index b669f0312..e22c7e788 100644 --- a/Makefile +++ b/Makefile @@ -78,14 +78,7 @@ endif GO111MODULE=off # Set default base image dynamically for each arch -BASEIMAGE?=quay.io/kubernetes-ingress-controller/nginx-$(ARCH):422f554ba9cb291b4402306d77e218dff63ffab4 - -ifeq ($(ARCH),arm) - QEMUARCH=arm -endif -ifeq ($(ARCH),arm64) - QEMUARCH=aarch64 -endif +BASEIMAGE?=quay.io/kubernetes-ingress-controller/nginx-$(ARCH):26f574dc279aa853736d7f7249965e90e47171d6 TEMP_DIR := $(shell mktemp -d) DOCKERFILE := $(TEMP_DIR)/rootfs/Dockerfile @@ -122,29 +115,20 @@ container: clean-container .container-$(ARCH) ## Build image for a particular ar cp -RP ./* $(TEMP_DIR) $(SED_I) "s|BASEIMAGE|$(BASEIMAGE)|g" $(DOCKERFILE) - $(SED_I) "s|QEMUARCH|$(QEMUARCH)|g" $(DOCKERFILE) $(SED_I) "s|VERSION|$(TAG)|g" $(DOCKERFILE) -ifeq ($(ARCH),amd64) - # When building "normally" for amd64, remove the whole line, it has no part in the amd64 image - $(SED_I) "/CROSS_BUILD_/d" $(DOCKERFILE) -else - # When cross-building, only the placeholder "CROSS_BUILD_" should be removed - curl -sSL https://github.com/multiarch/qemu-user-static/releases/download/v4.1.1-1/x86_64_qemu-$(QEMUARCH)-static.tar.gz | tar -xz -C $(TEMP_DIR)/rootfs - $(SED_I) "s/CROSS_BUILD_//g" $(DOCKERFILE) -endif - echo "Building docker image..." - $(DOCKER) build --no-cache --pull -t $(MULTI_ARCH_IMAGE):$(TAG) $(TEMP_DIR)/rootfs + $(DOCKER) buildx build \ + --no-cache \ + --load \ + --progress plain \ + --platform linux/$(ARCH) \ + -t $(MULTI_ARCH_IMAGE):$(TAG) $(TEMP_DIR)/rootfs .PHONY: clean-container clean-container: ## Removes local image @$(DOCKER) rmi -f $(MULTI_ARCH_IMAGE):$(TAG) || true -.PHONY: register-qemu -register-qemu: ## Register /usr/bin/qemu-ARCH-static as the handler for binaries in multiple platforms - @$(DOCKER) run --rm --privileged multiarch/qemu-user-static:register --reset >&2 - .PHONY: push push: .push-$(ARCH) ## Publish image for a particular arch. @@ -267,7 +251,7 @@ dep-ensure: check-go-version ## Update and vendo go dependencies. .PHONY: dev-env dev-env: check-go-version ## Starts a local Kubernetes cluster using minikube, building and deploying the ingress controller. - @USE_DOCKER=false build/dev-env.sh + @DIND_DOCKER=0 USE_DOCKER=false build/dev-env.sh .PHONY: live-docs live-docs: ## Build and launch a local copy of the documentation website in http://localhost:3000 diff --git a/build/run-in-docker.sh b/build/run-in-docker.sh index b155f2835..4088151bc 100755 --- a/build/run-in-docker.sh +++ b/build/run-in-docker.sh @@ -30,7 +30,7 @@ function cleanup { } trap cleanup EXIT -E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v01042020-8fb2695d5 +E2E_IMAGE=quay.io/kubernetes-ingress-controller/e2e:v01142020-3f0df1c35 DOCKER_OPTS=${DOCKER_OPTS:-} diff --git a/images/e2e/Dockerfile b/images/e2e/Dockerfile index 0ff0702a0..588165ce5 100644 --- a/images/e2e/Dockerfile +++ b/images/e2e/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM quay.io/kubernetes-ingress-controller/nginx-amd64:422f554ba9cb291b4402306d77e218dff63ffab4 +FROM quay.io/kubernetes-ingress-controller/nginx-amd64:26f574dc279aa853736d7f7249965e90e47171d6 ARG GOLANG_VERSION ARG GOLANG_SHA @@ -33,7 +33,6 @@ RUN [ ! -e /etc/nsswitch.conf ] && echo 'hosts: files dns' > /etc/nsswitch.conf RUN apk add --no-cache \ bash \ ca-certificates \ - parallel \ wget \ make \ gcc \ diff --git a/images/e2e/Makefile b/images/e2e/Makefile index af9022eda..6cbc51f9d 100644 --- a/images/e2e/Makefile +++ b/images/e2e/Makefile @@ -14,15 +14,15 @@ TAG ?=v$(shell date +%m%d%Y)-$(shell git rev-parse --short HEAD) REGISTRY ?= quay.io/kubernetes-ingress-controller -DOCKER ?= docker IMAGE = $(REGISTRY)/e2e all: docker-build docker-push docker-build: - $(DOCKER) build \ + docker build \ --pull \ + --load \ --build-arg K8S_RELEASE=v1.15.7 \ --build-arg ETCD_VERSION=v3.3.18 \ --build-arg GOLANG_VERSION=1.13.5 \ @@ -32,6 +32,6 @@ docker-build: -t $(IMAGE):$(TAG) . docker-push: - $(DOCKER) push $(IMAGE):$(TAG) - $(DOCKER) tag $(IMAGE):$(TAG) $(IMAGE):latest - $(DOCKER) push $(IMAGE):latest + docker push $(IMAGE):$(TAG) + docker tag $(IMAGE):$(TAG) $(IMAGE):latest + docker push $(IMAGE):latest diff --git a/internal/ingress/controller/template/template.go b/internal/ingress/controller/template/template.go index 6ba3e1bbf..75d36a2c7 100644 --- a/internal/ingress/controller/template/template.go +++ b/internal/ingress/controller/template/template.go @@ -949,7 +949,7 @@ func buildOpentracing(input interface{}) string { buf.WriteString("opentracing_load_tracer /usr/local/lib/libjaegertracing_plugin.so /etc/nginx/opentracing.json;") } } else if cfg.DatadogCollectorHost != "" { - buf.WriteString("opentracing_load_tracer /usr/local/lib/libdd_opentracing.so /etc/nginx/opentracing.json;") + buf.WriteString("opentracing_load_tracer /usr/local/lib64/libdd_opentracing.so /etc/nginx/opentracing.json;") } buf.WriteString("\r\n") diff --git a/internal/ingress/controller/template/template_test.go b/internal/ingress/controller/template/template_test.go index cb98236f4..28ab4212d 100644 --- a/internal/ingress/controller/template/template_test.go +++ b/internal/ingress/controller/template/template_test.go @@ -1184,7 +1184,7 @@ func TestBuildOpenTracing(t *testing.T) { EnableOpentracing: true, DatadogCollectorHost: "datadog-host.com", } - expected = "opentracing_load_tracer /usr/local/lib/libdd_opentracing.so /etc/nginx/opentracing.json;\r\n" + expected = "opentracing_load_tracer /usr/local/lib64/libdd_opentracing.so /etc/nginx/opentracing.json;\r\n" actual = buildOpentracing(cfgDatadog) if expected != actual { diff --git a/rootfs/Dockerfile b/rootfs/Dockerfile index 1ff30e443..64b471f42 100644 --- a/rootfs/Dockerfile +++ b/rootfs/Dockerfile @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM BASEIMAGE +FROM --platform=$BUILDPLATFORM BASEIMAGE LABEL org.opencontainers.image.title='NGINX Ingress Controller for Kubernetes' LABEL org.opencontainers.image.documentation='https://kubernetes.github.io/ingress-nginx/' @@ -21,8 +21,6 @@ LABEL org.opencontainers.image.vendor='The Kubernetes Authors' LABEL org.opencontainers.image.licenses='Apache-2.0' LABEL org.opencontainers.image.version='VERSION' -CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ - WORKDIR /etc/nginx RUN apk add -U --no-cache \ diff --git a/test/e2e-image/Dockerfile b/test/e2e-image/Dockerfile index 9011f3ccc..69e371bba 100644 --- a/test/e2e-image/Dockerfile +++ b/test/e2e-image/Dockerfile @@ -1,4 +1,4 @@ -FROM quay.io/kubernetes-ingress-controller/e2e:v01042020-8fb2695d5 AS BASE +FROM quay.io/kubernetes-ingress-controller/e2e:v01142020-3f0df1c35 AS BASE FROM alpine:3.11 diff --git a/test/e2e/run.sh b/test/e2e/run.sh index 678d2d996..4f25fc4b7 100755 --- a/test/e2e/run.sh +++ b/test/e2e/run.sh @@ -43,6 +43,8 @@ export REGISTRY=ingress-controller export K8S_VERSION=${K8S_VERSION:-v1.17.0} +export DOCKER_CLI_EXPERIMENTAL=enabled + KIND_CLUSTER_NAME="ingress-nginx-dev" kind --version || $(echo "Please install kind before running e2e tests";exit 1)