From 8becfb8b39201c7bf83c195529d82c5b42dfe8ed Mon Sep 17 00:00:00 2001 From: Torin Sandall Date: Wed, 29 Apr 2020 16:14:21 -0400 Subject: [PATCH] Dockerfile: Go back to scratch Now that we can build with CGO_ENABLED=0 we do not have to use a base image that provides libc. Remove distroless for the normal and rootless images and use scratch instead. Signed-off-by: Torin Sandall --- Dockerfile | 4 ++-- Makefile | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index c197d84bdb..301b0b44f2 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,9 +2,9 @@ # Use of this source code is governed by an Apache2 # license that can be found in the LICENSE file. -ARG VARIANT +ARG BASE -FROM gcr.io/distroless/base${VARIANT} +FROM ${BASE} # Any non-zero number will do, and unfortunately a named user will not, as k8s # pod securityContext runAsNonRoot can't resolve the user ID: diff --git a/Makefile b/Makefile index 5633cb3120..62921035d6 100644 --- a/Makefile +++ b/Makefile @@ -212,9 +212,9 @@ build-windows: .PHONY: image-quick image-quick: - $(DOCKER) build -t $(IMAGE):$(VERSION) . - $(DOCKER) build -t $(IMAGE):$(VERSION)-debug --build-arg VARIANT=:debug . - $(DOCKER) build -t $(IMAGE):$(VERSION)-rootless --build-arg USER=1000 . + $(DOCKER) build -t $(IMAGE):$(VERSION) --build-arg BASE=scratch . + $(DOCKER) build -t $(IMAGE):$(VERSION)-debug --build-arg BASE=gcr.io/distroless/base:debug . + $(DOCKER) build -t $(IMAGE):$(VERSION)-rootless --build-arg USER=1000 --build-arg BASE=scratch . .PHONY: push push: