Deprecate registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
Context
Add an image for golangci linting (!238 - merged) introduced the image to be built that would include certain dependencies and include a default configuration to any new Golan project that is listed in the the Go styleguide.
Problem
The golangci-lint
project is very active, and new releases come fairly often as seen in https://github.com/golangci/golangci-lint/releases.
This means that we are currently running an "old" version v1.50.1
of the linter for the tag golangci-lint-alpine
; and the latest version as of today is v1.54.2
.
Also, keeping up with updates creates a maintenance burden and there is no DRI for staying up to date.
Proposed solution
As of the latest version v1.54.2
, the image is basedon golang:1.21
which includes git
and all the Go tooling.
docker run -ti --rm -v $PWD:/go/app -w /go/app golangci/golangci-lint:v1.54.2 bash
root@573e1c434fd4:/go/app# git --version
git version 2.39.2
root@573e1c434fd4:/go/app# go version
go version go1.21.0 linux/arm64
root@573e1c434fd4:/go/app#
Based on the above, we should probably deprecate this image and tag registry.gitlab.com/gitlab-org/gitlab-build-images:golangci-lint-alpine
along with the other golangci-lint-alpine-XYZ
(see tag list).
However, since we are far outdated, we can do a staged update of the images following these steps:
1. Add a Dockerfile
that uses FROM golangci/golangci-lint:latest
and tag as golangci-lint-alpine-latest
. This will allow users to start running the linter with the latest tag and fix any issues. Perhaps adding a warning to ask users to use the official image instead.
-
Update Go guidelines to stop suggesting custom image. Deprecate custom golangci-lint image (gitlab!146143 - merged) -
Deprecate tags golangci-lint-alpine-XYZ
. Deprecate custom golangci-lint images (!786 - merged) -
Eventually remove all the Dockerfiles for golangci-lint
.
Some related issues #126 #108 #99 container-registry#1106