feat: add minimal tag #57
This commit is contained in:
@@ -7,6 +7,8 @@ on:
|
||||
- main
|
||||
paths:
|
||||
- 'docker/Dockerfile.base'
|
||||
- 'docker/Dockerfile.debian13.base'
|
||||
- 'docker/Dockerfile.debian13.minimal'
|
||||
|
||||
env:
|
||||
REGISTRY: ghcr.io
|
||||
@@ -18,7 +20,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, slim]
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
@@ -47,6 +49,14 @@ jobs:
|
||||
platform: linux/arm64
|
||||
dockerfile: docker/Dockerfile.debian13.base
|
||||
tag_suffix: "-debian13"
|
||||
- base_type: minimal
|
||||
platform: linux/amd64
|
||||
dockerfile: docker/Dockerfile.debian13.minimal
|
||||
tag_suffix: "-minimal"
|
||||
- base_type: minimal
|
||||
platform: linux/arm64
|
||||
dockerfile: docker/Dockerfile.debian13.minimal
|
||||
tag_suffix: "-minimal"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -116,7 +126,7 @@ jobs:
|
||||
needs: build
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, slim]
|
||||
include:
|
||||
- base_type: debian
|
||||
tag: base
|
||||
@@ -124,6 +134,8 @@ jobs:
|
||||
# tag: base-alpine
|
||||
- base_type: debian13
|
||||
tag: base-debian13
|
||||
- base_type: minimal
|
||||
tag: base-minimal
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, minimal]
|
||||
include:
|
||||
- base_type: debian
|
||||
base_tag: base
|
||||
@@ -25,6 +25,9 @@ jobs:
|
||||
- base_type: debian13
|
||||
base_tag: base-debian13
|
||||
tag_suffix: "-debian13"
|
||||
- base_type: minimal
|
||||
base_tag: base-minimal
|
||||
tag_suffix: "-minimal"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -14,7 +14,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, minimal]
|
||||
include:
|
||||
- base_type: debian
|
||||
base_tag: base
|
||||
@@ -25,6 +25,9 @@ jobs:
|
||||
- base_type: debian13
|
||||
base_tag: base-debian13
|
||||
tag_suffix: "-debian13"
|
||||
- base_type: minimal
|
||||
base_tag: base-minimal
|
||||
tag_suffix: "-minimal"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
@@ -89,7 +89,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, slim]
|
||||
platform:
|
||||
- linux/amd64
|
||||
- linux/arm64
|
||||
@@ -118,6 +118,14 @@ jobs:
|
||||
platform: linux/arm64
|
||||
base_tag: base-debian13
|
||||
tag_suffix: "-debian13"
|
||||
- base_type: minimal
|
||||
platform: linux/amd64
|
||||
base_tag: base-minimal
|
||||
tag_suffix: "-minimal"
|
||||
- base_type: minimal
|
||||
platform: linux/arm64
|
||||
base_tag: base-minimal
|
||||
tag_suffix: "-minimal"
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
@@ -193,7 +201,7 @@ jobs:
|
||||
needs: [build, build-binaries]
|
||||
strategy:
|
||||
matrix:
|
||||
base_type: [debian, debian13]
|
||||
base_type: [debian, debian13, slim]
|
||||
include:
|
||||
- base_type: debian
|
||||
tag_suffix: ""
|
||||
@@ -201,6 +209,8 @@ jobs:
|
||||
# tag_suffix: "-alpine"
|
||||
- base_type: debian13
|
||||
tag_suffix: "-debian13"
|
||||
- base_type: minimal
|
||||
tag_suffix: "-minimal"
|
||||
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
FROM debian:trixie-slim
|
||||
|
||||
ENV TZ=Asia/Shanghai
|
||||
ENV MISE_DATA_DIR=/opt/mise-base
|
||||
ENV MISE_CONFIG_DIR=/opt/mise-base
|
||||
ENV PATH="/opt/mise-base/shims:/opt/mise-base/bin:$PATH"
|
||||
|
||||
# 安装必要系统工具并仅预装 mise
|
||||
RUN sed -i 's@deb.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& sed -i 's@security.debian.org@mirrors.tuna.tsinghua.edu.cn@g' /etc/apt/sources.list.d/debian.sources \
|
||||
&& echo "${TZ}" > /etc/timezone \
|
||||
&& ln -sf /usr/share/zoneinfo/${TZ} /etc/localtime \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y --no-install-recommends \
|
||||
tzdata git curl wget vim htop ca-certificates rsync \
|
||||
&& curl https://mise.run | MISE_INSTALL_PATH=/usr/local/bin/mise sh \
|
||||
&& rm -rf /var/lib/apt/lists/* \
|
||||
&& rm -rf /root/.cache/mise /opt/mise-base/cache/*
|
||||
@@ -41,8 +41,10 @@ export MISE_DATA_DIR="$MISE_DIR"
|
||||
export MISE_CONFIG_DIR="$MISE_DIR"
|
||||
export PATH="$MISE_DIR/shims:$MISE_DIR/bin:$PATH"
|
||||
|
||||
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (类似 Python site-packages 行为)
|
||||
export NODE_PATH=$(npm root -g 2>/dev/null)
|
||||
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (仅当 npm 存在时执行)
|
||||
if command -v npm >/dev/null 2>&1; then
|
||||
export NODE_PATH=$(npm root -g 2>/dev/null)
|
||||
fi
|
||||
|
||||
# 默认启用 Python 镜像源
|
||||
export PIP_INDEX_URL=${PIP_INDEX_URL:-https://pypi.org/simple}
|
||||
@@ -55,9 +57,9 @@ export PYTHONPATH=/app/data/scripts:$PYTHONPATH
|
||||
# 打印确认
|
||||
# ============================
|
||||
log "mise version: $(mise --version 2>/dev/null | head -n 1)"
|
||||
log "python: $(python --version 2>&1 | head -n 1) at $(which python)"
|
||||
log "node: $(node --version 2>&1 | head -n 1) at $(which node)"
|
||||
log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)"
|
||||
[ -x "$(command -v python)" ] && log "python: $(python --version 2>&1 | head -n 1) at $(which python)" || log "python: not installed"
|
||||
[ -x "$(command -v node)" ] && log "node: $(node --version 2>&1 | head -n 1) at $(which node)" || log "node: not installed"
|
||||
[ -x "$(command -v npm)" ] && log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)" || log "npm: not installed"
|
||||
|
||||
# ============================
|
||||
# 将 baihu 注册到全局命令
|
||||
|
||||
Reference in New Issue
Block a user