mirror of https://github.com/docker/cli.git
[20.10] Dockerfile.lint: use go install
"go get@version" is no longer supported on newer versions of go. Also renaming the build-arg to match what's used in master. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
f14ba9f5d7
commit
b3022b91d1
|
@ -1,16 +1,16 @@
|
||||||
# syntax=docker/dockerfile:1
|
# syntax=docker/dockerfile:1
|
||||||
|
|
||||||
ARG GO_VERSION=1.17.13
|
ARG GO_VERSION=1.17.13
|
||||||
ARG GOLANGCI_LINTER_SHA=v1.45.2
|
ARG GOLANGCI_LINT_VERSION=v1.45.2
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine AS build
|
FROM golang:${GO_VERSION}-alpine AS build
|
||||||
ENV CGO_ENABLED=0
|
ENV CGO_ENABLED=0
|
||||||
RUN apk add --no-cache git
|
RUN apk add --no-cache git
|
||||||
ARG GOLANGCI_LINTER_SHA
|
ARG GOLANGCI_LINT_VERSION
|
||||||
ARG GO111MODULE=on
|
ARG GO111MODULE=on
|
||||||
RUN --mount=type=cache,target=/root/.cache/go-build \
|
RUN --mount=type=cache,target=/root/.cache/go-build \
|
||||||
--mount=type=cache,target=/go/pkg/mod \
|
--mount=type=cache,target=/go/pkg/mod \
|
||||||
go get github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINTER_SHA}
|
go install github.com/golangci/golangci-lint/cmd/golangci-lint@${GOLANGCI_LINT_VERSION}
|
||||||
|
|
||||||
FROM golang:${GO_VERSION}-alpine AS lint
|
FROM golang:${GO_VERSION}-alpine AS lint
|
||||||
ENV GO111MODULE=off
|
ENV GO111MODULE=off
|
||||||
|
|
Loading…
Reference in New Issue