restructure per-image dirs + onpush paths filter; add beszel-agent-gpu image
gitea-mcp image / build (arm64) (push) Successful in 13s
beszel-agent-gpu image / build (amd64) (push) Successful in 31s
beszel-agent-gpu image / amend-manifest (push) Successful in 3s
gitea-mcp image / amend-manifest (push) Successful in 9s

This commit is contained in:
thuanle committed 2026-09-07 15:49:50 +07:00
1 parent c0306bba7f
commit b823333d5d
7 files changed
+178 -17

No files matched your search

+70
View File
@@ -0,0 +1,70 @@
name: beszel-agent-gpu image
on:
push:
paths:
- beszel-agent-gpu/**
schedule:
- cron: '30 2 * * 0' # 02:30 sáng Chủ nhật (UTC), lệch giờ với gitea-mcp
workflow_dispatch: # Cho phép chạy tay nếu cần
env:
IMAGE_REPO: git.thuanle.me/public/beszel-agent-gpu
IMAGE: beszel-agent-gpu
jobs:
build:
strategy:
matrix:
arch:
# GPU NVIDIA chỉ có trên máy amd64 (server ta)
- amd64
runs-on: ${{ matrix.arch }}
steps:
- name: Checkout
uses: actions/checkout@v7
- name: Login to Docker Registry
uses: docker/login-action@v4
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 }}"
# --pull: luôn lấy binary / base image mới nhất, đây là cơ chế
# update hàng tuần của image này
docker build \
--pull \
-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@v4
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
docker manifest push ${{ env.IMAGE_REPO }}:latest
@@ -1,13 +1,16 @@
name: docker-node image name: gitea-mcp image
on: on:
push: push:
paths:
- gitea-mcp/**
schedule: schedule:
- cron: '0 2 * * 0' # 00:00 sáng Chủ nhật (UTC) - cron: '0 2 * * 0' # 02: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
env: env:
IMAGE_REPO: git.thuanle.me/public/gitea-mcp IMAGE_REPO: git.thuanle.me/public/gitea-mcp
IMAGE: gitea-mcp
jobs: jobs:
build: build:
@@ -30,15 +33,15 @@ jobs:
- name: Build Docker images - name: Build Docker images
run: | run: |
echo "Building image ${{ env.IMAGE_REPO }} for architecture: ${{ matrix.arch }}" echo "Building image ${{ env.IMAGE }} for architecture: ${{ matrix.arch }}"
docker build \ docker build \
-f gitea-mcp.Dockerfile \ -f ${{ env.IMAGE }}/Dockerfile \
--build-arg TARGETARCH=${{ matrix.arch }} \ --build-arg TARGETARCH=${{ matrix.arch }} \
-t ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest \ -t ${{ env.IMAGE_REPO }}:${{ 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_REPO }}:${{ matrix.arch }}-latest docker push ${{ env.IMAGE_REPO }}:${{ matrix.arch }}-latest
@@ -62,4 +65,4 @@ jobs:
docker manifest create ${{ env.IMAGE_REPO }}:latest \ docker manifest create ${{ env.IMAGE_REPO }}:latest \
${{ env.IMAGE_REPO }}:arm64-latest ${{ env.IMAGE_REPO }}:arm64-latest
docker manifest push ${{ env.IMAGE_REPO }}:latest docker manifest push ${{ env.IMAGE_REPO }}:latest
+24 -10
View File
@@ -2,22 +2,36 @@
Repo này nhằm để build lại các Docker image hay dùng, đồng thời tự động cập nhật theo lịch hàng tuần. Repo này nhằm để build lại các Docker image hay dùng, đồng thời tự động cập nhật theo lịch hàng tuần.
## Cấu trúc
Mỗi image nằm trong một thư mục riêng, kèm workflow riêng build khi có thay đổi liên quan:
- Dockerfile: `<tên image>/Dockerfile` (chi tiết xem `<tên image>/README.md`)
- Workflow: `.gitea/workflows/<tên image>.yml` — chạy khi push thay đổi `<tên image>/**` và theo lịch cron hằng tuần
## Images ## Images
### gitea-mcp ### gitea-mcp
Registry: `git.thuanle.me/public/image:gitea-mcp-latest` - Registry: `git.thuanle.me/public/gitea-mcp:latest`
- Dockerfile: [gitea-mcp/Dockerfile](gitea-mcp/Dockerfile)
Image chạy [gitea-mcp](https://gitea.com/gitea/gitea-mcp) — MCP server cho Gitea. - Image chạy [gitea-mcp](https://gitea.com/gitea/gitea-mcp) — MCP server cho Gitea.
- Base: `alpine:latest`, tự động lấy phiên bản mới nhất từ Gitea releases khi build
- Base: `alpine:latest` - Hỗ trợ kiến trúc: `arm64`
- Tự động lấy phiên bản mới nhất từ Gitea releases khi build
- Hỗ trợ kiến trúc: `amd64`, `arm64`, `i386`
- Build tự động mỗi Chủ nhật lúc 02:00 UTC - Build tự động mỗi Chủ nhật lúc 02:00 UTC
**Chạy:**
```bash ```bash
docker run --rm git.thuanle.me/public/image:gitea-mcp-latest --help docker run --rm git.thuanle.me/public/gitea-mcp:latest --help
``` ```
### beszel-agent-gpu
- Registry: `git.thuanle.me/public/beszel-agent-gpu:latest`
- Dockerfile: [beszel-agent-gpu/Dockerfile](beszel-agent-gpu/Dockerfile)
- [beszel-agent](https://github.com/henrygd/beszel) chạy trong môi trường glibc để thu thập GPU stats NVIDIA (image chính thức là distroless nên không chạy được `nvidia-smi`).
- Chỉ build cho `amd64` (dành cho server có GPU NVIDIA, hiện là `ta`)
- Build lại mỗi Chủ nhật lúc 02:30 UTC với `--pull` để lấy binary agent mới nhất; server tiêu thụ qua watchtower
## Update
- Repo được build lại hàng tuần theo cron của từng workflow.
+21
View File
@@ -0,0 +1,21 @@
# beszel-agent chính thức chạy trong môi trường có glibc.
#
# Tại sao không dùng henrygd/beszel-agent trực tiếp: image chính thức là
# distroless (không có glibc / dynamic linker) nên nvidia-smi được NVIDIA
# Container Toolkit inject vào container (binary link glibc) không thể exec,
# và binary phát hành build không có tag `glibc` nên NVML chỉ là stub —
# GPU NVIDIA do đó không bao giờ được báo cáo. Ubuntu cung cấp glibc cho
# phép nvidia-smi chạy để agent thu thập GPU stats.
FROM ubuntu:24.04
# TLS: image ubuntu gốc không kèm CA bundle, thiếu nó agent không verify được
# chứng chỉ của hub (x509: certificate signed by unknown authority).
RUN apt-get update \
&& apt-get install -y --no-install-recommends ca-certificates \
&& rm -rf /var/lib/apt/lists/*
# Binary Go tĩnh từ image chính thức + bảng id GPU AMD (giữ parity).
COPY --from=henrygd/beszel-agent /agent /agent
COPY --from=henrygd/beszel-agent /usr/share/libdrm/amdgpu.ids /usr/share/libdrm/amdgpu.ids
ENTRYPOINT ["/agent"]
+41
View File
@@ -0,0 +1,41 @@
# beszel-agent-gpu
[beszel-agent](https://github.com/henrygd/beszel) chạy trong môi trường glibc để thu thập được GPU stats NVIDIA, thay cho image distroless chính thức (xem chú thích trong [Dockerfile](Dockerfile)).
## Tags
- `git.thuanle.me/public/beszel-agent-gpu:latest` — manifest trỏ `amd64-latest`
- `git.thuanle.me/public/beszel-agent-gpu:amd64-latest`
## Sử dụng (server có NVIDIA GPU)
```yaml
services:
beszel-agent:
image: git.thuanle.me/public/beszel-agent-gpu:latest
container_name: beszel-agent
restart: unless-stopped
labels:
- com.centurylinklabs.watchtower.enable=true
network_mode: host
# GPU: agent chạy nvidia-smi do NVIDIA Container Toolkit inject
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
- ./beszel_agent_data:/var/lib/beszel-agent
environment:
LISTEN: 45876
KEY: '<public key từ hub>'
HUB_URL: https://bz.thuanle.me
```
## Update
- Build lại tự động mỗi Chủ nhật 02:30 UTC với `--pull` — luôn lấy binary agent mới nhất từ `henrygd/beszel-agent`.
- Server tiêu thụ (ta) chạy watchtower `--label-enable`, nên container tự update sau khi image mới được push.
File renamed without changes.
+12
View File
@@ -0,0 +1,12 @@
# gitea-mcp
Image chase [gitea-mcp](https://gitea.com/gitea/gitea-mcp) — MCP server cho Gitea.
- Base: `alpine:latest`, tự tải binary phiên bản mới nhất từ Gitea releases khi build
- Hỗ trợ kiến trúc: `arm64`
- Tags: `git.thuanle.me/public/gitea-mcp:latest`, `:arm64-latest`
- Build tự động mỗi Chủ nhật lúc 02:00 UTC
```bash
docker run --rm git.thuanle.me/public/gitea-mcp:latest --help
```