Compare commits
9
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89b4c47410 | ||
|
|
64ba252e49 | ||
|
|
f25d883c66 | ||
|
|
c438d72ef8 | ||
|
|
d86a9cf73a | ||
|
|
b00d4f285f | ||
|
|
02d39658a2 | ||
|
|
387ec20381 | ||
|
|
eadc66ab1e |
No files matched your search
@@ -25,7 +25,7 @@ jobs:
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
paths:
|
||||
- node-go/**
|
||||
schedule:
|
||||
- cron: '0 2 * * 0' # 02:00 sáng Chủ nhật (UTC)
|
||||
- cron: '0 4 * * 0' # 04:00 sáng Chủ nhật (UTC)
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
name: node-python-docker image
|
||||
|
||||
on:
|
||||
push:
|
||||
paths:
|
||||
- node-python-docker/**
|
||||
schedule:
|
||||
- cron: '0 6 * * 0' # 06:00 sáng Chủ nhật (UTC)
|
||||
workflow_dispatch: # Cho phép chạy tay nếu cần
|
||||
|
||||
env:
|
||||
IMAGE_BASE: git.thuanle.me/public/base
|
||||
IMAGE: node-python-docker
|
||||
|
||||
jobs:
|
||||
build:
|
||||
strategy:
|
||||
matrix:
|
||||
arch:
|
||||
- arm64
|
||||
- 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 }}"
|
||||
|
||||
docker build \
|
||||
-f ${{ env.IMAGE }}/Dockerfile \
|
||||
-t ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ 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_BASE }}:${{ env.IMAGE }}-${{ 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_BASE }}:${{ env.IMAGE }}-latest || true
|
||||
|
||||
echo "Create new manifest"
|
||||
docker manifest create ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-latest \
|
||||
${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-amd64-latest \
|
||||
${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-arm64-latest
|
||||
|
||||
docker manifest push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-latest
|
||||
@@ -5,7 +5,7 @@ on:
|
||||
paths:
|
||||
- node-python/**
|
||||
schedule:
|
||||
- cron: '0 1 * * 0' # 01: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
|
||||
|
||||
env:
|
||||
@@ -25,7 +25,7 @@ jobs:
|
||||
uses: actions/checkout@v7
|
||||
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
@@ -49,7 +49,7 @@ jobs:
|
||||
needs: [build]
|
||||
steps:
|
||||
- name: Login to Docker Registry
|
||||
uses: docker/login-action@v3
|
||||
uses: docker/login-action@v4
|
||||
with:
|
||||
registry: git.thuanle.me
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
|
||||
@@ -32,6 +32,17 @@ Kho lưu trữ này cung cấp các Docker base image cho nhiều mục đích s
|
||||
- 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)
|
||||
|
||||
- **node-python-docker**
|
||||
- `git.thuanle.me/public/base:node-python-docker-latest`
|
||||
- Dockerfile: [node-python-docker/Dockerfile](node-python-docker/Dockerfile)
|
||||
- Workflow: [.gitea/workflows/node-python-docker.yml](.gitea/workflows/node-python-docker.yml)
|
||||
- Các gói/phần mềm đã cài đặt:
|
||||
- **Node.js** kèm theo **npm** và **yarn**
|
||||
- **git**
|
||||
- **python v3** (virtualenv mặc định `/opt/venv`)
|
||||
- **Docker CLI** (mount `/var/run/docker.sock` khi chạy)
|
||||
|
||||
|
||||
## Update
|
||||
|
||||
- Repo được update hàng tuần.
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
FROM node:lts-slim
|
||||
|
||||
ARG GO_VERSION=1.26
|
||||
ARG GOLANGCI_LINT_VERSION=v2.13.1
|
||||
ARG GOLANGCI_LINT_VERSION=v2.15.0
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
PATH=/usr/local/go/bin:${PATH}
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
FROM node:lts-slim
|
||||
|
||||
ENV DEBIAN_FRONTEND=noninteractive \
|
||||
DOCKER_HOST=unix:///var/run/docker.sock
|
||||
|
||||
# Cài git + Python 3 (Debian stable) + Docker CLI (repo chính thức Docker)
|
||||
RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
ca-certificates curl gnupg lsb-release \
|
||||
git \
|
||||
python3 python3-pip python3-venv; \
|
||||
install -m 0755 -d /etc/apt/keyrings; \
|
||||
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc; \
|
||||
chmod a+r /etc/apt/keyrings/docker.asc; \
|
||||
. /etc/os-release; \
|
||||
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian ${VERSION_CODENAME} stable" \
|
||||
> /etc/apt/sources.list.d/docker.list; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends docker-ce-cli; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Tạo virtualenv mặc định cho mọi thứ Python trong container
|
||||
# => bạn dùng `python`/`pip` là vào venv này luôn
|
||||
RUN python3 -m venv /opt/venv \
|
||||
&& /opt/venv/bin/python -m pip install --upgrade pip setuptools wheel
|
||||
|
||||
ENV PATH="/opt/venv/bin:${PATH}"
|
||||
|
||||
WORKDIR /app
|
||||
@@ -7,7 +7,7 @@ RUN set -eux; \
|
||||
apt-get update; \
|
||||
apt-get install -y --no-install-recommends \
|
||||
git \
|
||||
python3 python3-pip python3-venv python3-distutils; \
|
||||
python3 python3-pip python3-venv; \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# Tạo virtualenv mặc định cho mọi thứ Python trong container
|
||||
|
||||
Reference in new issue
Block a user