2022-05-03 10:51:31 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2024-03-27 15:59:13 +00:00
|
|
|
ARG GO_VERSION=1.21.8
|
2023-12-22 09:06:51 +00:00
|
|
|
ARG ALPINE_VERSION=3.19
|
2023-11-18 06:50:40 +00:00
|
|
|
ARG GOLANGCI_LINT_VERSION=v1.55.2
|
2023-12-10 09:09:52 +00:00
|
|
|
ARG BUILDTAGS=""
|
2022-05-03 10:51:31 +00:00
|
|
|
|
|
|
|
FROM golangci/golangci-lint:${GOLANGCI_LINT_VERSION}-alpine AS golangci-lint
|
|
|
|
|
2022-07-20 12:19:39 +00:00
|
|
|
FROM golang:${GO_VERSION}-alpine${ALPINE_VERSION} AS base
|
2022-05-03 10:51:31 +00:00
|
|
|
RUN apk add --no-cache gcc musl-dev
|
|
|
|
WORKDIR /src
|
|
|
|
|
|
|
|
FROM base
|
2022-05-05 08:20:56 +00:00
|
|
|
ENV GOFLAGS="-buildvcs=false"
|
2022-05-03 10:51:31 +00:00
|
|
|
RUN --mount=type=bind,target=. \
|
2022-07-20 14:44:31 +00:00
|
|
|
--mount=type=cache,target=/root/.cache \
|
|
|
|
--mount=from=golangci-lint,source=/usr/bin/golangci-lint,target=/usr/bin/golangci-lint \
|
2023-06-28 10:41:22 +00:00
|
|
|
golangci-lint --build-tags "${BUILDTAGS}" run
|