chore: build-node-base-image

This commit is contained in:
xiaojunnuo
2025-12-29 22:54:19 +08:00
parent f7863bd686
commit 1625989c48
3 changed files with 72 additions and 0 deletions

56
.github/workflows/base-image-build.yml vendored Normal file
View File

@@ -0,0 +1,56 @@
name: build-node-base-image
on:
push:
branches: ['v2-dev']
paths:
- "scripts/build/Dockerfile"
# workflow_run:
# workflows: [ "deploy-demo" ]
# types:
# - completed
# schedule:
# - # 国际时间 19:17 执行北京时间3:17 ↙↙↙ 改成你想要每天自动执行的时间
# - cron: '17 19 * * *'
permissions:
contents: read
packages: write
jobs:
build-node-base-image:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
fetch-depth: 0
lfs: true
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.dockerhub_username }}
password: ${{ secrets.dockerhub_password }}
- name: Build default platforms
uses: docker/build-push-action@v6
with:
platforms: linux/amd64,linux/arm64
push: true
context: ./scripts/build/
tags: |
greper/node-base:22-alpine-1
- name: Build armv7
uses: docker/build-push-action@v6
with:
platforms: linux/arm/v7
push: true
context: ./scripts/build/
tags: |
greper/node-base:22-alpine-1-armv7

8
scripts/build/Dockerfile Normal file
View File

@@ -0,0 +1,8 @@
FROM node:22-alpine AS builder
RUN apk add build-base
RUN wget -O - https://github.com/jemalloc/jemalloc/releases/download/5.3.0/jemalloc-5.3.0.tar.bz2 | tar -xj && \
cd jemalloc-5.3.0 && \
./configure && \
make && \
make install

View File

@@ -0,0 +1,8 @@
version: '3.3' # 指定docker-compose 版本
services: # 要拉起的服务们
node-base:
build:
context: ./
dockerfile: Dockerfile
image: greper/node-base:22-alpine-1