From 2a4eb84c5e1fe49be7af82bb0d6cef1b850e869a Mon Sep 17 00:00:00 2001 From: "Timothy St. Clair" Date: Mon, 6 Nov 2017 10:08:56 -0600 Subject: [PATCH] Update targets and images to use our internal images to use golang 1.9 Signed-off-by: Timothy St. Clair --- Dockerfile | 12 +++++------- Makefile | 7 +++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1456a83f8..3cc6d7ca9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,15 +12,13 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM buildpack-deps:jessie-scm +FROM gcr.io/heptio-images/golang:1.9-alpine3.6 MAINTAINER Timothy St. Clair "tstclair@heptio.com" -RUN apt-get update && apt-get -y --no-install-recommends install \ - ca-certificates \ - && rm -rf /var/cache/apt/* \ - && rm -rf /var/lib/apt/lists/* -ADD sonobuoy /sonobuoy +RUN apk add --no-cache ca-certificates +ADD sonobuoy /sonobuoy ADD scripts/run_master.sh /run_master.sh -#USER nobody:nobody +# TODO - Verify execution is fine as nobody user to drop privs +# USER nobody:nobody CMD ["/bin/sh", "-c", "/run_master.sh"] diff --git a/Makefile b/Makefile index 6c7a5f769..79d946128 100644 --- a/Makefile +++ b/Makefile @@ -33,7 +33,7 @@ IMAGE_BRANCH ?= $(shell git rev-parse --abbrev-ref HEAD | sed 's/\///g') GIT_REF = $(shell git rev-parse --short=8 --verify HEAD) BUILDMNT = /go/src/$(GOTARGET) -BUILD_IMAGE ?= golang:1.8 +BUILD_IMAGE ?= gcr.io/heptio-images/golang:1.9-alpine3.6 BUILDCMD = go build -o $(TARGET) -v -ldflags "-X github.com/heptio/sonobuoy/pkg/buildinfo.Version=$(GIT_VERSION) -X github.com/heptio/sonobuoy/pkg/buildinfo.DockerImage=$(REGISTRY)/$(TARGET):$(GIT_REF)" BUILD = $(BUILDCMD) $(GOTARGET)/cmd/sonobuoy @@ -44,16 +44,15 @@ TEST = go test $(TEST_PKGS) $(TESTARGS) VET = go vet $(TEST_PKGS) # Vendor this someday -INSTALL_GOLINT = go get -u github.com/golang/lint/golint GOLINT_FLAGS ?= -set_exit_status -LINT = $(INSTALL_GOLINT) && golint $(GOLINT_FLAGS) $(TEST_PKGS) +LINT = golint $(GOLINT_FLAGS) $(TEST_PKGS) WORKDIR ?= /sonobuoy RBAC_ENABLED ?= 1 KUBECFG_CMD = $(DOCKER) run \ -v $(DIR):$(WORKDIR) \ --workdir $(WORKDIR) \ -- --rm \ + --rm \ $(KSONNET_BUILD_IMAGE) \ kubecfg show -o yaml -V RBAC_ENABLED=$(RBAC_ENABLED) -J $(WORKDIR) -o yaml $< > $@