diff --git a/.golangci.yml b/.golangci.yml index 2c6f43826..ad6665dcd 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -1,4 +1,9 @@ linters: + run: + concurrency: 2 + modules-download-mode: vendor + skip-dirs: + - vendor enable-all: false disable-all: true enable: diff --git a/Dockerfile b/Dockerfile index 987bc2c55..7fbac7ea0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,9 +1,9 @@ -FROM dockercore/golang-cross:1.12.9@sha256:3ea9dcef4dd2c46d80445c0b22d6177817f4cfce22c523cc12a5a1091cb37705 AS cli-build +FROM dockercore/golang-cross:1.13.10@sha256:ad2725ac9af0273f1de9bb85e166084d5e8d915df334154fe9c8bd9af912a90d AS cli-build ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 ARG CLI_CHANNEL=stable -ARG CLI_VERSION=19.03.5 +ARG CLI_VERSION=19.03.8 -RUN apt-get install -y -q --no-install-recommends \ +RUN apt-get update && apt-get install -y -q --no-install-recommends \ coreutils \ util-linux \ uuid-runtime @@ -21,7 +21,7 @@ ARG GOPROXY RUN make binary-windows # main dev image -FROM golang:1.13.3 AS dev +FROM golang:1.13.10 AS dev RUN apt-get update && apt-get install -y -q --no-install-recommends \ coreutils \ @@ -35,7 +35,7 @@ ENV PATH=${PATH}:/go/src/github.com/docker/app/bin/ ARG DEP_VERSION=v0.5.4 RUN curl -o /usr/bin/dep -L https://github.com/golang/dep/releases/download/${DEP_VERSION}/dep-linux-amd64 && \ chmod +x /usr/bin/dep -ARG GOTESTSUM_VERSION=v0.3.4 +ARG GOTESTSUM_VERSION=v0.4.2 ARG GOPROXY RUN mkdir $GOPATH/src/gotest.tools && \ git clone -q https://github.com/gotestyourself/gotestsum $GOPATH/src/gotest.tools/gotestsum && \ diff --git a/Dockerfile.invocation-image b/Dockerfile.invocation-image index 211443b20..449079fed 100644 --- a/Dockerfile.invocation-image +++ b/Dockerfile.invocation-image @@ -1,6 +1,6 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 -FROM golang:1.13.2 AS build +FROM golang:1.13.10 AS build RUN apt-get update -qq && apt-get install -y -q --no-install-recommends \ coreutils \ diff --git a/Dockerfile.lint b/Dockerfile.lint index 7de086689..f3a02f023 100644 --- a/Dockerfile.lint +++ b/Dockerfile.lint @@ -1,15 +1,16 @@ -ARG ALPINE_VERSION=3.10 -ARG GO_VERSION=1.12.9 +ARG ALPINE_VERSION=3.11 +ARG GO_VERSION=1.13.10 FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} RUN apk add --no-cache \ curl \ git \ make \ - coreutils + coreutils \ + build-base RUN GO111MODULE=on go get \ - github.com/golangci/golangci-lint/cmd/golangci-lint@v1.16.0 \ + github.com/golangci/golangci-lint/cmd/golangci-lint@v1.23.0 \ && rm -rf /go/src/* /go/pkg/* WORKDIR /go/src/github.com/docker/app diff --git a/Makefile b/Makefile index 4620d886c..7db67c0b8 100644 --- a/Makefile +++ b/Makefile @@ -67,7 +67,7 @@ test: test-unit test-e2e ## run all tests lint: ## run linter(s) @echo "Linting..." - @golangci-lint run ./... + golangci-lint run --verbose --print-resources-usage --timeout 10m0s ./... test-e2e: bin/$(BIN_NAME) ## run end-to-end tests @echo "Running e2e tests..." diff --git a/docs/yaml/Dockerfile b/docs/yaml/Dockerfile index 45e867410..9c1c1e212 100644 --- a/docs/yaml/Dockerfile +++ b/docs/yaml/Dockerfile @@ -1,4 +1,4 @@ -FROM golang:1.12-alpine AS base +FROM golang:1.13-alpine AS base ARG PROJECT=github.com/docker/app ARG PROJECT_PATH=/go/src/${PROJECT} diff --git a/e2e/helper_test.go b/e2e/helper_test.go index d489086a9..cdc591a44 100644 --- a/e2e/helper_test.go +++ b/e2e/helper_test.go @@ -122,14 +122,13 @@ func runWithDindSwarmAndRegistry(t *testing.T, todo func(dindSwarmAndRegistryInf todo(runner) } -func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) string { +func build(t *testing.T, cmd icmd.Cmd, dockerCli dockerCliCommand, ref, path string) { iidfile := fs.NewFile(t, "iid") defer iidfile.Remove() cmd.Command = dockerCli.Command("app", "build", "--iidfile", iidfile.Path(), "-t", ref, path) icmd.RunCmd(cmd).Assert(t, icmd.Success) - bytes, err := ioutil.ReadFile(iidfile.Path()) + _, err := ioutil.ReadFile(iidfile.Path()) assert.NilError(t, err) - return string(bytes) } // Container represents a docker container diff --git a/e2e/testdata/cnab-parameters/cnab/build/Dockerfile b/e2e/testdata/cnab-parameters/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-parameters/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-parameters/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile b/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-with-docker-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile b/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile index bf6ad536a..05820db88 100644 --- a/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-with-standard-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.3 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/e2e/testdata/cnab-without-status/cnab/build/Dockerfile b/e2e/testdata/cnab-without-status/cnab/build/Dockerfile index ab1af2cad..05820db88 100644 --- a/e2e/testdata/cnab-without-status/cnab/build/Dockerfile +++ b/e2e/testdata/cnab-without-status/cnab/build/Dockerfile @@ -1,4 +1,4 @@ -ARG ALPINE_VERSION=3.10.1 +ARG ALPINE_VERSION=3.11.5 FROM alpine:${ALPINE_VERSION} diff --git a/internal/commands/image/tag_test.go b/internal/commands/image/tag_test.go index acc95c794..8639f764d 100644 --- a/internal/commands/image/tag_test.go +++ b/internal/commands/image/tag_test.go @@ -95,7 +95,7 @@ func TestInvalidDestinationReference(t *testing.T) { err := runTag(mockedImageStore, "ref", badRef) - assert.ErrorContains(t, err, fmt.Sprintf("invalid reference format")) + assert.ErrorContains(t, err, "invalid reference format") } func TestBundleNotStored(t *testing.T) { diff --git a/loader/loader_test.go b/loader/loader_test.go index 8009e8b8c..e035ea1eb 100644 --- a/loader/loader_test.go +++ b/loader/loader_test.go @@ -35,7 +35,7 @@ func TestLoadFromDirectory(t *testing.T) { app, err := LoadFromDirectory(dir.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, dir.Path())) + assert.Assert(t, is.Equal(app.Path, dir.Path())) //nolint:staticcheck assertAppContent(t, app) } @@ -62,7 +62,7 @@ func TestLoadFromTar(t *testing.T) { app, err := LoadFromTar(myapp.Path()) assert.NilError(t, err) assert.Assert(t, app != nil) - assert.Assert(t, is.Equal(app.Path, myapp.Path())) + assert.Assert(t, is.Equal(app.Path, myapp.Path())) //nolint:staticcheck assertAppContent(t, app) } diff --git a/vars.mk b/vars.mk index 51b172769..c608e790b 100644 --- a/vars.mk +++ b/vars.mk @@ -2,7 +2,7 @@ PKG_NAME := github.com/docker/app BIN_NAME ?= docker-app E2E_NAME := $(BIN_NAME)-e2e -ALPINE_VERSION=3.10.3 +ALPINE_VERSION=3.11.5 # Failing to resolve sh.exe to a full path denotes a windows vanilla shell. # Although 'simple' commands are still exec'ed, 'complex' ones are batch'ed instead of sh'ed.