node-python image
Some checks failed
docker-node image / build (arm64) (push) Successful in 1m9s
node-python image / build (amd64) (push) Failing after 1m33s
node-python image / build (arm64) (push) Failing after 23s
node-python image / amend-manifest (push) Has been skipped
docker-node image / build (amd64) (push) Successful in 2m55s
docker-node image / amend-manifest (push) Successful in 14s
Some checks failed
docker-node image / build (arm64) (push) Successful in 1m9s
node-python image / build (amd64) (push) Failing after 1m33s
node-python image / build (arm64) (push) Failing after 23s
node-python image / amend-manifest (push) Has been skipped
docker-node image / build (amd64) (push) Successful in 2m55s
docker-node image / amend-manifest (push) Successful in 14s
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
name: Weekly Docker Build
|
name: docker-node image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
@@ -43,7 +43,7 @@ jobs:
|
|||||||
docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
|
docker push ${{ env.IMAGE_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest
|
||||||
|
|
||||||
amend-manifest:
|
amend-manifest:
|
||||||
runs-on: ubuntu-latest
|
runs-on: linux
|
||||||
needs: [build]
|
needs: [build]
|
||||||
steps:
|
steps:
|
||||||
- name: Login to Docker Registry
|
- name: Login to Docker Registry
|
||||||
|
|||||||
66
.gitea/workflows/node-python.yml
Normal file
66
.gitea/workflows/node-python.yml
Normal file
@@ -0,0 +1,66 @@
|
|||||||
|
name: node-python image
|
||||||
|
|
||||||
|
on:
|
||||||
|
push:
|
||||||
|
schedule:
|
||||||
|
- 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:
|
||||||
|
IMAGE_BASE: git.thuanle.me/public/base
|
||||||
|
IMAGE: node-python
|
||||||
|
|
||||||
|
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_BASE }}:${{ env.IMAGE }}-${{ matrix.arch }}-latest \
|
||||||
|
--label "build_date=$(date -u +'%Y-%m-%dT%H:%M:%SZ')" \
|
||||||
|
--label "commit_sha=${{ github.sha }}" \
|
||||||
|
.
|
||||||
|
|
||||||
|
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@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_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
|
||||||
@@ -1,19 +1,20 @@
|
|||||||
# Node LTS 24 trên Debian 12 (Bookworm) bản slim
|
FROM node:22-slim
|
||||||
FROM node:latest
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive \
|
ENV DEBIAN_FRONTEND=noninteractive \
|
||||||
DOCKER_HOST=unix:///var/run/docker.sock
|
DOCKER_HOST=unix:///var/run/docker.sock
|
||||||
|
|
||||||
# Cài Docker CLI từ repo chính thức của Docker (lấy bản mới nhất)
|
# Cài git + Docker CLI (repo chính thức Docker)
|
||||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
RUN set -eux; \
|
||||||
ca-certificates curl gnupg git lsb-release \
|
apt-get update; \
|
||||||
&& install -m 0755 -d /etc/apt/keyrings \
|
apt-get install -y --no-install-recommends ca-certificates curl gnupg lsb-release git; \
|
||||||
&& curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc \
|
install -m 0755 -d /etc/apt/keyrings; \
|
||||||
&& chmod a+r /etc/apt/keyrings/docker.asc \
|
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc; \
|
||||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] \
|
chmod a+r /etc/apt/keyrings/docker.asc; \
|
||||||
https://download.docker.com/linux/debian $(. /etc/os-release; echo $VERSION_CODENAME) stable" \
|
. /etc/os-release; \
|
||||||
> /etc/apt/sources.list.d/docker.list \
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian ${VERSION_CODENAME} stable" \
|
||||||
&& apt-get update \
|
> /etc/apt/sources.list.d/docker.list; \
|
||||||
&& apt-get install -y --no-install-recommends docker-ce-cli \
|
apt-get update; \
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
apt-get install -y --no-install-recommends docker-ce-cli; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
|
|||||||
16
node-python.Dockerfile
Normal file
16
node-python.Dockerfile
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
FROM node:22-slim
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
|
# Cài git + Python 3.11 (Debian stable)
|
||||||
|
RUN set -eux; \
|
||||||
|
apt-get update; \
|
||||||
|
apt-get install -y --no-install-recommends \
|
||||||
|
git \
|
||||||
|
python3 python3-pip python3-venv python3-distutils; \
|
||||||
|
rm -rf /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# (tuỳ chọn) nâng pip lên mới nhất
|
||||||
|
RUN python3 -m pip install --upgrade pip
|
||||||
|
|
||||||
|
WORKDIR /app
|
||||||
Reference in New Issue
Block a user