distribution/dockerfiles/lint.Dockerfile
Milos Gajdos 83a071e98a
Bump alpine version
Signed-off-by: Milos Gajdos <milosthegajdos@gmail.com>
2024-06-30 16:59:12 +01:00

19 lines
577 B
Docker

# syntax=docker/dockerfile:1
ARG GO_VERSION=1.22.4
ARG ALPINE_VERSION=3.20
ARG GOLANGCI_LINT_VERSION=v1.59.1
ARG BUILDTAGS=""
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
RUN apk add --no-cache gcc musl-dev
WORKDIR /src
FROM base
ENV GOFLAGS="-buildvcs=false"
RUN --mount=type=bind,target=. \
--mount=type=cache,target=/root/.cache \
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
golangci-lint --build-tags "${BUILDTAGS}" run