From 1b4f73c972e3454b3243a628b55d67f2fe2042f0 Mon Sep 17 00:00:00 2001 From: Tim Hockin Date: Mon, 25 Mar 2019 08:07:50 -0700 Subject: [PATCH] use vendor in tests --- Dockerfile.in | 4 +++- Makefile | 2 +- build/test.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) 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