diff --git a/Dockerfile.in b/Dockerfile.in index 0464399..50eb588 100644 --- a/Dockerfile.in +++ b/Dockerfile.in @@ -16,5 +16,7 @@ FROM {ARG_FROM} ADD bin/{ARG_OS}_{ARG_ARCH}/{ARG_BIN} /{ARG_BIN} -USER nobody:nobody +# This would be nicer as `nobody:nobody` but distroless has no such entries. +USER 65535:65535 + ENTRYPOINT ["/{ARG_BIN}"] diff --git a/Makefile b/Makefile index 1555e7f..d16ffe4 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ ALL_PLATFORMS := linux/amd64 linux/arm linux/arm64 linux/ppc64le linux/s390x OS := $(if $(GOOS),$(GOOS),$(shell go env GOOS)) ARCH := $(if $(GOARCH),$(GOARCH),$(shell go env GOARCH)) -BASEIMAGE ?= k8s.gcr.io/debian-base:0.4.1 +BASEIMAGE ?= gcr.io/distroless/static IMAGE := $(REGISTRY)/$(BIN) TAG := $(VERSION)__$(OS)_$(ARCH) diff --git a/build/test.sh b/build/test.sh index 49b36a1..0512283 100755 --- a/build/test.sh +++ b/build/test.sh @@ -19,11 +19,11 @@ set -o nounset set -o pipefail export CGO_ENABLED=0 +export GOFLAGS="-mod=vendor" TARGETS=$(for d in "$@"; do echo ./$d/...; done) echo "Running tests:" -go test -i -installsuffix "static" ${TARGETS} go test -installsuffix "static" ${TARGETS} echo