Files
thuanleandClaude 155991fcbc
node-go image / build (amd64) (push) Failing after 1s
node-go image / build (arm64) (push) Failing after 53s
node-go image / amend-manifest (push) Skipped
feat(node-go): add golangci-lint + Renovate auto-bump
- Add golangci-lint v2.12.2 to node-go image (arch-aware via official install.sh)
- Wire renovate.json to auto-bump GOLANGCI_LINT_VERSION (minor/patch automerge)
  and GO_VERSION (patch automerge); keep pins for reproducible/rollback-able builds
- Add node-go/README.md documenting installed tools and what's NOT included
- Update root README accordingly

Co-Authored-By: Claude <noreply@anthropic.com>
2026-08-11 15:20:24 +07:00
..

node-go

Docker base image gồm Node.js + Go + công cụ lint, dùng làm môi trường build/test cho CI.

Kiến trúc được hỗ trợ

  • linux/amd64
  • linux/arm64

Image được build song song cho cả hai kiến trúc rồi gộp vào một multi-arch manifest, kéo bằng :latest sẽ tự nhận đúng kiến trúc của host.

Đã cài đặt sẵn

Phần mềm Phiên bản Ghi chú
Node.js LTS (cùng phiên bản với node:lts-slim) kèm npmyarn
Go 1.26 cài nhị phân chính thức từ go.dev, đặt tại /usr/local/go
golangci-lint v2.12.2 cài vào /usr/local/bin, dùng cho go lint/CI
git (apt)
gcc + libc6-dev (apt) cần cho cgo và một số package Go build bằng C
ca-certificates, curl (apt)

Các phiên bản Go/golangci-lint được pin bằng ARG trong Dockerfile (GO_VERSION, GOLANGCI_LINT_VERSION) để build ổn định & rollback được, đồng thời Renovate tự bump qua PR khi có release mới:

  • golangci-lint: auto-merge minor/patch (major vd v2→v3 mở PR review).
  • Go: auto-merge patch; minor (vd 1.26→1.27) mở PR review.

Cách sử dụng

# .gitea/workflows/...
container:
  image: git.thuanle.me/public/node-go:latest
steps:
  - run: node -v && go version && golangci-lint version
  - run: golangci-lint run ./...
  - run: go test ./...

Hoặc chạy cục bộ:

docker run --rm git.thuanle.me/public/node-go:latest \
  sh -c "go version && golangci-lint version"

Những gì KHÔNG có (có thể cần cài thêm)

Image này cố gắng nhỏ gọn, nên một số thứ sau không được cài sẵn — cài thêm trong CI/Dockerfile của dự án nếu cần:

  • Docker CLI — nếu cần build/push image, dùng image docker-node thay thế.
  • Python — dùng image node-python.
  • Make, jq, zip/unzip, openssh-client… — apt-get install trong pipeline khi cần.
  • Các Go tool cụ thể của dự án (vd: mockgen, protoc-gen-go, wire…) — go install ...@<version> trong bước CI, vì mỗi dự án cần phiên bản khác nhau.
  • Hồ sơ Git (user.name/user.email) — tự cấu hình trong CI.

Nâng cấp

  • Tự động (mặc định): Renovate theo dõi GO_VERSIONGOLANGCI_LINT_VERSION, tự mở PR (và auto-merge theo quy tắc ở trên) khi có release mới. PR merge → workflow build lại image.
  • Thủ công (khi cần bump major, vd golangci-lint v2→v3 hoặc Go 1.26→1.27): sửa trực tiếp ARG trong Dockerfile rồi push.
  • Image cũng được build lại hàng tuần theo lịch (cron) trong workflow.