From 058733969c4216b9be8338a4a57e90d080751520 Mon Sep 17 00:00:00 2001 From: Daniel Nephin Date: Tue, 15 Aug 2017 14:32:44 -0400 Subject: [PATCH] Set DISABLE_WARN_OUTSIDE_CONTAINER in the Dockerfile so that we don't spend 10s sleeping in CI also add time to validate check Signed-off-by: Daniel Nephin --- Makefile | 7 +++++++ circle.yml | 4 ++-- docker.Makefile | 2 +- dockerfiles/Dockerfile.cross | 1 + dockerfiles/Dockerfile.dev | 3 ++- dockerfiles/Dockerfile.lint | 1 + dockerfiles/Dockerfile.shellcheck | 12 ++++++------ 7 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Makefile b/Makefile index 81b0041b84..ccf36b4665 100644 --- a/Makefile +++ b/Makefile @@ -65,3 +65,10 @@ cli/compose/schema/bindata.go: cli/compose/schema/data/*.json compose-jsonschema: cli/compose/schema/bindata.go scripts/validate/check-git-diff cli/compose/schema/bindata.go + +.PHONY: ci-validate +ci-validate: + time make -B vendor + time make -B compose-jsonschema + time make manpages + time make yamldocs diff --git a/circle.yml b/circle.yml index ecf597fa36..53fcac7389 100644 --- a/circle.yml +++ b/circle.yml @@ -90,7 +90,7 @@ jobs: rm -f .dockerignore # include .git docker build -f $dockerfile --tag cli-builder-with-git:$CIRCLE_BUILD_NUM . docker run --rm cli-builder-with-git:$CIRCLE_BUILD_NUM \ - make -B vendor compose-jsonschema manpages yamldocs + make ci-validate shellcheck: working_directory: /work docker: [{image: 'docker:17.06-git'}] @@ -104,7 +104,7 @@ jobs: echo "COPY . ." >> $dockerfile docker build -f $dockerfile --tag cli-validator:$CIRCLE_BUILD_NUM . docker run --rm cli-validator:$CIRCLE_BUILD_NUM \ - make -B shellcheck + make shellcheck workflows: version: 2 ci: diff --git a/docker.Makefile b/docker.Makefile index 4aaee5489a..b7a34da314 100644 --- a/docker.Makefile +++ b/docker.Makefile @@ -10,7 +10,7 @@ CROSS_IMAGE_NAME = docker-cli-cross VALIDATE_IMAGE_NAME = docker-cli-shell-validate MOUNTS = -v "$(CURDIR)":/go/src/github.com/docker/cli VERSION = $(shell cat VERSION) -ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT -e DISABLE_WARN_OUTSIDE_CONTAINER=1 +ENVVARS = -e VERSION=$(VERSION) -e GITCOMMIT # build docker image (dockerfiles/Dockerfile.build) .PHONY: build_docker_image diff --git a/dockerfiles/Dockerfile.cross b/dockerfiles/Dockerfile.cross index 60487dca90..d4b900cab1 100644 --- a/dockerfiles/Dockerfile.cross +++ b/dockerfiles/Dockerfile.cross @@ -1,2 +1,3 @@ FROM dockercore/golang-cross@sha256:d24e7affa3a85d460d2303c2549f03fc866f2b97d771ccf07b0e6e2b411dd207 +ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 WORKDIR /go/src/github.com/docker/cli diff --git a/dockerfiles/Dockerfile.dev b/dockerfiles/Dockerfile.dev index 5b9d35f516..dc67eeb07f 100644 --- a/dockerfiles/Dockerfile.dev +++ b/dockerfiles/Dockerfile.dev @@ -25,6 +25,7 @@ RUN go get -d github.com/dnephin/filewatcher && \ rm -rf /go/src/* /go/pkg/* /go/bin/* ENV CGO_ENABLED=0 \ - PATH=$PATH:/go/src/github.com/docker/cli/build + PATH=$PATH:/go/src/github.com/docker/cli/build \ + DISABLE_WARN_OUTSIDE_CONTAINER=1 WORKDIR /go/src/github.com/docker/cli CMD sh diff --git a/dockerfiles/Dockerfile.lint b/dockerfiles/Dockerfile.lint index c981efbadc..4b3cccf085 100644 --- a/dockerfiles/Dockerfile.lint +++ b/dockerfiles/Dockerfile.lint @@ -12,5 +12,6 @@ RUN go get -d github.com/alecthomas/gometalinter && \ WORKDIR /go/src/github.com/docker/cli ENV CGO_ENABLED=0 +ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 ENTRYPOINT ["/usr/local/bin/gometalinter"] CMD ["--config=gometalinter.json", "./..."] diff --git a/dockerfiles/Dockerfile.shellcheck b/dockerfiles/Dockerfile.shellcheck index 12f665f7a7..43112b314d 100644 --- a/dockerfiles/Dockerfile.shellcheck +++ b/dockerfiles/Dockerfile.shellcheck @@ -1,9 +1,9 @@ -FROM debian:stretch-slim +FROM debian:stretch-slim -RUN apt-get update && \ - apt-get -y install make shellcheck && \ - apt-get clean +RUN apt-get update && \ + apt-get -y install make shellcheck && \ + apt-get clean WORKDIR /go/src/github.com/docker/cli - -CMD bash +ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 +CMD bash