diff --git a/Dockerfile b/Dockerfile index 8b89729af6..d29c0a7f5b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -216,3 +216,6 @@ ENTRYPOINT ["hack/dind"] # Upload docker source COPY . /go/src/github.com/docker/docker + +# Options for hack/validate/gometalinter +ENV GOMETALINTER_OPTS="--deadline 2m" diff --git a/Dockerfile.aarch64 b/Dockerfile.aarch64 index a15a3fe6a0..dde140cdb7 100644 --- a/Dockerfile.aarch64 +++ b/Dockerfile.aarch64 @@ -173,7 +173,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ # Please edit hack/dockerfile/install-binaries.sh to update them. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli +RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter ENV PATH=/usr/local/cli:$PATH # Wrap all commands in the "docker-in-docker" script to allow nested containers @@ -181,3 +181,6 @@ ENTRYPOINT ["hack/dind"] # Upload docker source COPY . /go/src/github.com/docker/docker + +# Options for hack/validate/gometalinter +ENV GOMETALINTER_OPTS="--deadline 4m -j2" diff --git a/Dockerfile.armhf b/Dockerfile.armhf index ff78234ad7..abd07ac263 100644 --- a/Dockerfile.armhf +++ b/Dockerfile.armhf @@ -162,10 +162,13 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ # Please edit hack/dockerfile/install-binaries.sh to update them. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli +RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter ENV PATH=/usr/local/cli:$PATH ENTRYPOINT ["hack/dind"] # Upload docker source COPY . /go/src/github.com/docker/docker + +# Options for hack/validate/gometalinter +ENV GOMETALINTER_OPTS="--deadline 10m -j2" diff --git a/Dockerfile.ppc64le b/Dockerfile.ppc64le index 171fbfa726..e6534906ce 100644 --- a/Dockerfile.ppc64le +++ b/Dockerfile.ppc64le @@ -160,7 +160,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ # Please edit hack/dockerfile/install-binaries.sh to update them. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli +RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter ENV PATH=/usr/local/cli:$PATH # Wrap all commands in the "docker-in-docker" script to allow nested containers diff --git a/Dockerfile.s390x b/Dockerfile.s390x index eb99853185..34a01f8156 100644 --- a/Dockerfile.s390x +++ b/Dockerfile.s390x @@ -153,7 +153,7 @@ RUN ./contrib/download-frozen-image-v2.sh /docker-frozen-images \ # Please edit hack/dockerfile/install-binaries.sh to update them. COPY hack/dockerfile/binaries-commits /tmp/binaries-commits COPY hack/dockerfile/install-binaries.sh /tmp/install-binaries.sh -RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli +RUN /tmp/install-binaries.sh tomlv vndr runc containerd tini proxy dockercli gometalinter ENV PATH=/usr/local/cli:$PATH # Wrap all commands in the "docker-in-docker" script to allow nested containers diff --git a/daemon/graphdriver/overlay/copy.go b/daemon/graphdriver/overlay/copy.go index 8c35b91ddc..f7e35e2bd3 100644 --- a/daemon/graphdriver/overlay/copy.go +++ b/daemon/graphdriver/overlay/copy.go @@ -157,9 +157,10 @@ func copyDir(srcDir, dstDir string, flags copyFlags) error { } // system.Chtimes doesn't support a NOFOLLOW flag atm + // nolint: unconvert if !isSymlink { - aTime := time.Unix(stat.Atim.Sec, stat.Atim.Nsec) - mTime := time.Unix(stat.Mtim.Sec, stat.Mtim.Nsec) + aTime := time.Unix(int64(stat.Atim.Sec), int64(stat.Atim.Nsec)) + mTime := time.Unix(int64(stat.Mtim.Sec), int64(stat.Mtim.Nsec)) if err := system.Chtimes(dstPath, aTime, mTime); err != nil { return err } diff --git a/hack/validate/gometalinter b/hack/validate/gometalinter index 9830659d69..ae411e864a 100755 --- a/hack/validate/gometalinter +++ b/hack/validate/gometalinter @@ -3,4 +3,9 @@ set -e -o pipefail SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" -gometalinter --config $SCRIPTDIR/gometalinter.json ./... +# CI platforms differ, so per-platform GOMETALINTER_OPTS can be set +# from a platform-specific Dockerfile, otherwise let's just set +# (somewhat pessimistic) default of 10 minutes. +gometalinter \ + ${GOMETALINTER_OPTS:--deadine 10m} \ + --config $SCRIPTDIR/gometalinter.json ./... diff --git a/hack/validate/gometalinter.json b/hack/validate/gometalinter.json index baa531e443..8e8da10a39 100644 --- a/hack/validate/gometalinter.json +++ b/hack/validate/gometalinter.json @@ -1,6 +1,5 @@ { "Vendor": true, - "Deadline": "2m", "EnableGC": true, "Sort": ["linter", "severity", "path"], "Exclude": [