Author SHA1 Message Date
thuanleandClaude 155991fcbc feat(node-go): add golangci-lint + Renovate auto-bump
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
- 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
thuanle 1e0f44962f Update .gitea/workflows/docker-node.yml 2026-08-02 11:38:49 +07:00
codex 9edcc1e9c9 docker armv7
docker-node image / build (armv7) (push) Failing after 2s
docker-node image / build (arm64) (push) Successful in 13s
docker-node image / build (amd64) (push) Successful in 45s
docker-node image / amend-manifest (push) Skipped
2026-07-28 20:06:42 +07:00
codex b543857595 docker armv7 2026-07-28 20:03:37 +07:00
thuanle 32f2065446 feat: update workflows and Dockerfiles for node-go, node-python, and docker-node images
docker-node image / build (arm64) (push) Successful in 15s
node-go image / build (arm64) (push) Successful in 16s
node-go image / build (amd64) (push) Successful in 7s
docker-node image / build (amd64) (push) Successful in 48s
node-python image / build (amd64) (push) Successful in 8s
docker-node image / amend-manifest (push) Successful in 5s
node-python image / build (arm64) (push) Successful in 15s
node-go image / amend-manifest (push) Successful in 15s
node-python image / amend-manifest (push) Successful in 14s
2026-06-23 16:49:10 +07:00
thuanle bb01daeb4d add gcc for go
docker-node image / build (amd64) (push) Successful in 9s
docker-node image / build (arm64) (push) Successful in 30s
docker-node image / amend-manifest (push) Successful in 19s
node-go image / build (amd64) (push) Successful in 1m14s
node-python image / build (amd64) (push) Failing after 1m17s
node-go image / build (arm64) (push) Successful in 1m46s
node-go image / amend-manifest (push) Successful in 9s
node-python image / build (arm64) (push) Successful in 32s
node-python image / amend-manifest (push) Has been skipped
2026-06-23 16:33:44 +07:00
thuanle 69591ec230 ci
docker-node image / build (arm64) (push) Successful in 5s
docker-node image / build (amd64) (push) Successful in 11s
node-python image / build (arm64) (push) Successful in 16s
docker-node image / amend-manifest (push) Successful in 14s
node-python image / build (amd64) (push) Successful in 21s
node-go image / build (arm64) (push) Successful in 43s
node-python image / amend-manifest (push) Successful in 4s
node-go image / build (amd64) (push) Successful in 1m16s
node-go image / amend-manifest (push) Successful in 14s
2026-04-28 00:11:02 +07:00
thuanle f7ebfffddb node-go
docker-node image / build (arm64) (push) Successful in 32s
docker-node image / build (amd64) (push) Successful in 55s
node-python image / build (arm64) (push) Successful in 1m2s
docker-node image / amend-manifest (push) Successful in 12s
node-python image / build (amd64) (push) Successful in 1m45s
node-python image / amend-manifest (push) Successful in 9s
2026-04-28 00:03:58 +07:00
thuanle cdaf343fc0 docs: add node-go base image design 2026-04-27 23:17:13 +07:00
10 changed files with 238 additions and 12 deletions
+4 -2
View File
@@ -2,6 +2,8 @@ name: docker-node image
on: on:
push: push:
paths:
- docker-node/**
schedule: schedule:
- cron: '0 0 * * 0' # 00:00 sáng Chủ nhật (UTC) - cron: '0 0 * * 0' # 00:00 sáng Chủ nhật (UTC)
workflow_dispatch: # Cho phép chạy tay nếu cần workflow_dispatch: # Cho phép chạy tay nếu cần
@@ -34,11 +36,11 @@ jobs:
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}" echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
docker build \ docker build \
-f ${{ env.IMAGE }}.Dockerfile \ -f ${{ env.IMAGE }}/Dockerfile \
-t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \ -t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ --label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--label "commit_sha=${{ github.sha }}" \ --label "commit_sha=${{ github.sha }}" \
. ${{ env.IMAGE }}
docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
+68
View File
@@ -0,0 +1,68 @@
name: node-go image
on:
push:
paths:
- node-go/**
schedule:
- cron: '0 2 * * 0' # 02:00 sáng Chủ nhật (UTC)
workflow_dispatch:
env:
IMAGE_REPO: git.thuanle.me/public/node-go
IMAGE: node-go
jobs:
build:
strategy:
matrix:
arch:
- arm64
- amd64
runs-on: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.thuanle.me
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build Docker images
run: |
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
docker build \
-f ${{ env.IMAGE }}/Dockerfile \
-t ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest \
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--label "commit_sha=${{ github.sha }}" \
${{ env.IMAGE }}
docker push ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest
amend-manifest:
runs-on: linux
needs: [build]
steps:
- name: Login to Docker Registry
uses: docker/login-action@v3
with:
registry: git.thuanle.me
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push Docker manifest
run: |
echo "Delete existing manifest"
docker manifest rm ${{ env.IMAGE_REPO }}:latest || true
echo "Create new manifest"
docker manifest create ${{ env.IMAGE_REPO }}:latest \
${{ env.IMAGE_REPO }}:amd64-latest \
${{ env.IMAGE_REPO }}:arm64-latest
docker manifest push ${{ env.IMAGE_REPO }}:latest
+4 -2
View File
@@ -2,6 +2,8 @@ name: node-python image
on: on:
push: push:
paths:
- node-python/**
schedule: schedule:
- cron: '0 1 * * 0' # 01:00 sáng Chủ nhật (UTC) - cron: '0 1 * * 0' # 01:00 sáng Chủ nhật (UTC)
workflow_dispatch: # Cho phép chạy tay nếu cần workflow_dispatch: # Cho phép chạy tay nếu cần
@@ -34,11 +36,11 @@ jobs:
echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}" echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
docker build \ docker build \
-f ${{ env.IMAGE }}.Dockerfile \ -f ${{ env.IMAGE }}/Dockerfile \
-t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \ -t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \ --label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
--label "commit_sha=${{ github.sha }}" \ --label "commit_sha=${{ github.sha }}" \
. ${{ env.IMAGE }}
docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
+14 -2
View File
@@ -6,7 +6,7 @@ Kho lưu trữ này cung cấp các Docker base image cho nhiều mục đích s
- **docker-node** - **docker-node**
- `git.thuanle.me/public/base:docker-node-latest` - `git.thuanle.me/public/base:docker-node-latest`
- Dockerfile: [docker-node.Dockerfile](docker-node.Dockerfile) - Dockerfile: [docker-node/Dockerfile](docker-node/Dockerfile)
- Các gói/phần mềm đã cài đặt: - Các gói/phần mềm đã cài đặt:
- **Node.js v22** kèm theo **npm****yarn** - **Node.js v22** kèm theo **npm****yarn**
- **Docker CLI** - **Docker CLI**
@@ -14,12 +14,24 @@ Kho lưu trữ này cung cấp các Docker base image cho nhiều mục đích s
- **node-python** - **node-python**
- `git.thuanle.me/public/base:node-python-latest` - `git.thuanle.me/public/base:node-python-latest`
- Dockerfile: [node-python.Dockerfile](node-python.Dockerfile) - Dockerfile: [node-python/Dockerfile](node-python/Dockerfile)
- Các gói/phần mềm đã cài đặt: - Các gói/phần mềm đã cài đặt:
- **Node.js** kèm theo **npm****yarn** - **Node.js** kèm theo **npm****yarn**
- **git** - **git**
- **python v3.11** - **python v3.11**
- **node-go**
- `git.thuanle.me/public/node-go:latest`
- Dockerfile: [node-go/Dockerfile](node-go/Dockerfile)
- Workflow: [.gitea/workflows/node-go.yml](.gitea/workflows/node-go.yml)
- Các gói/phần mềm đã cài đặt:
- **Node.js** kèm theo **npm****yarn**
- **git**
- **Go 1.26**
- **golangci-lint v2.12.2**
- Ghi chú:
- Phiên bản (`GO_VERSION`, `GOLANGCI_LINT_VERSION`) được pin trong Dockerfile; [Renovate](renovate.json) tự bump qua PR khi có release mới (auto-merge minor/patch)
## Update ## Update
- Repo được update hàng tuần. - Repo được update hàng tuần.
View File
+33
View File
@@ -0,0 +1,33 @@
FROM node:lts-slim
ARG GO_VERSION=1.26
ARG GOLANGCI_LINT_VERSION=v2.12.2
ENV DEBIAN_FRONTEND=noninteractive \
PATH=/usr/local/go/bin:${PATH}
RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends ca-certificates curl git gcc libc6-dev; \
arch="$(dpkg --print-architecture)"; \
case "${arch}" in \
amd64) go_arch='linux-amd64' ;; \
arm64) go_arch='linux-arm64' ;; \
*) echo "Unsupported architecture: ${arch}" >&2; exit 1 ;; \
esac; \
case "${GO_VERSION}" in \
*.*.*) download_go_version="${GO_VERSION}" ;; \
*.*) download_go_version="${GO_VERSION}.0" ;; \
*) echo "GO_VERSION must be major.minor or major.minor.patch: ${GO_VERSION}" >&2; exit 1 ;; \
esac; \
curl -fsSL "https://go.dev/dl/go${download_go_version}.${go_arch}.tar.gz" -o /tmp/go.tgz; \
rm -rf /usr/local/go; \
tar -C /usr/local -xzf /tmp/go.tgz; \
rm -f /tmp/go.tgz; \
curl -fsSL -o /tmp/golangci-lint-install.sh \
"https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh"; \
sh /tmp/golangci-lint-install.sh -b /usr/local/bin "${GOLANGCI_LINT_VERSION}"; \
rm -f /tmp/golangci-lint-install.sh; \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
+76
View File
@@ -0,0 +1,76 @@
# 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.
- Image: `git.thuanle.me/public/node-go:latest`
- Dockerfile: [Dockerfile](Dockerfile)
- Workflow: [`.gitea/workflows/node-go.yml`](../.gitea/workflows/node-go.yml)
## 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 **npm****yarn** |
| 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](../renovate.json) 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
```yaml
# .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ộ:
```bash
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`](../docker-node) thay thế.
- **Python** — dùng image [`node-python`](../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](../renovate.json) theo dõi `GO_VERSION`
`GOLANGCI_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](Dockerfile) rồi push.
- Image cũng được build lại hàng tuần theo lịch (`cron`) trong workflow.
+34 -1
View File
@@ -1,3 +1,36 @@
{ {
"$schema": "https://docs.renovatebot.com/renovate-schema.json" "$schema": "https://docs.renovatebot.com/renovate-schema.json",
"customManagers": [
{
"customType": "regex",
"description": "Bump golangci-lint version ARG trong node-go/Dockerfile",
"fileMatch": ["node-go/Dockerfile$"],
"matchStrings": ["ARG GOLANGCI_LINT_VERSION=(?<currentValue>\\S+)"],
"datasourceTemplate": "github-releases",
"depNameTemplate": "golangci/golangci-lint"
},
{
"customType": "regex",
"description": "Bump Go version ARG trong node-go/Dockerfile",
"fileMatch": ["node-go/Dockerfile$"],
"matchStrings": ["ARG GO_VERSION=(?<currentValue>\\S+)"],
"datasourceTemplate": "golang-version",
"depNameTemplate": "go"
}
],
"packageRules": [
{
"description": "golangci-lint: auto-merge minor/patch, major (vd v2->v3) can review",
"matchDatasources": ["github-releases"],
"matchPackageNames": ["golangci/golangci-lint"],
"matchUpdateTypes": ["minor", "patch"],
"automerge": true
},
{
"description": "Go: chi auto-merge patch; minor (vd 1.26->1.27) can review thu cong",
"matchDatasources": ["golang-version"],
"matchUpdateTypes": ["patch"],
"automerge": true
}
]
} }