feat: add minimal tag #57
This commit is contained in:
@@ -7,6 +7,8 @@ on:
|
|||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'docker/Dockerfile.base'
|
- 'docker/Dockerfile.base'
|
||||||
|
- 'docker/Dockerfile.debian13.base'
|
||||||
|
- 'docker/Dockerfile.debian13.minimal'
|
||||||
|
|
||||||
env:
|
env:
|
||||||
REGISTRY: ghcr.io
|
REGISTRY: ghcr.io
|
||||||
@@ -18,7 +20,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, slim]
|
||||||
platform:
|
platform:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
@@ -47,6 +49,14 @@ jobs:
|
|||||||
platform: linux/arm64
|
platform: linux/arm64
|
||||||
dockerfile: docker/Dockerfile.debian13.base
|
dockerfile: docker/Dockerfile.debian13.base
|
||||||
tag_suffix: "-debian13"
|
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:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -116,7 +126,7 @@ jobs:
|
|||||||
needs: build
|
needs: build
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, slim]
|
||||||
include:
|
include:
|
||||||
- base_type: debian
|
- base_type: debian
|
||||||
tag: base
|
tag: base
|
||||||
@@ -124,6 +134,8 @@ jobs:
|
|||||||
# tag: base-alpine
|
# tag: base-alpine
|
||||||
- base_type: debian13
|
- base_type: debian13
|
||||||
tag: base-debian13
|
tag: base-debian13
|
||||||
|
- base_type: minimal
|
||||||
|
tag: base-minimal
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, minimal]
|
||||||
include:
|
include:
|
||||||
- base_type: debian
|
- base_type: debian
|
||||||
base_tag: base
|
base_tag: base
|
||||||
@@ -25,6 +25,9 @@ jobs:
|
|||||||
- base_type: debian13
|
- base_type: debian13
|
||||||
base_tag: base-debian13
|
base_tag: base-debian13
|
||||||
tag_suffix: "-debian13"
|
tag_suffix: "-debian13"
|
||||||
|
- base_type: minimal
|
||||||
|
base_tag: base-minimal
|
||||||
|
tag_suffix: "-minimal"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, minimal]
|
||||||
include:
|
include:
|
||||||
- base_type: debian
|
- base_type: debian
|
||||||
base_tag: base
|
base_tag: base
|
||||||
@@ -25,6 +25,9 @@ jobs:
|
|||||||
- base_type: debian13
|
- base_type: debian13
|
||||||
base_tag: base-debian13
|
base_tag: base-debian13
|
||||||
tag_suffix: "-debian13"
|
tag_suffix: "-debian13"
|
||||||
|
- base_type: minimal
|
||||||
|
base_tag: base-minimal
|
||||||
|
tag_suffix: "-minimal"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, slim]
|
||||||
platform:
|
platform:
|
||||||
- linux/amd64
|
- linux/amd64
|
||||||
- linux/arm64
|
- linux/arm64
|
||||||
@@ -118,6 +118,14 @@ jobs:
|
|||||||
platform: linux/arm64
|
platform: linux/arm64
|
||||||
base_tag: base-debian13
|
base_tag: base-debian13
|
||||||
tag_suffix: "-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:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
@@ -193,7 +201,7 @@ jobs:
|
|||||||
needs: [build, build-binaries]
|
needs: [build, build-binaries]
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
base_type: [debian, debian13]
|
base_type: [debian, debian13, slim]
|
||||||
include:
|
include:
|
||||||
- base_type: debian
|
- base_type: debian
|
||||||
tag_suffix: ""
|
tag_suffix: ""
|
||||||
@@ -201,6 +209,8 @@ jobs:
|
|||||||
# tag_suffix: "-alpine"
|
# tag_suffix: "-alpine"
|
||||||
- base_type: debian13
|
- base_type: debian13
|
||||||
tag_suffix: "-debian13"
|
tag_suffix: "-debian13"
|
||||||
|
- base_type: minimal
|
||||||
|
tag_suffix: "-minimal"
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
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 MISE_CONFIG_DIR="$MISE_DIR"
|
||||||
export PATH="$MISE_DIR/shims:$MISE_DIR/bin:$PATH"
|
export PATH="$MISE_DIR/shims:$MISE_DIR/bin:$PATH"
|
||||||
|
|
||||||
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (类似 Python site-packages 行为)
|
# 使 Node.js 运行脚本时能够自动找到全局安装的模块 (仅当 npm 存在时执行)
|
||||||
export NODE_PATH=$(npm root -g 2>/dev/null)
|
if command -v npm >/dev/null 2>&1; then
|
||||||
|
export NODE_PATH=$(npm root -g 2>/dev/null)
|
||||||
|
fi
|
||||||
|
|
||||||
# 默认启用 Python 镜像源
|
# 默认启用 Python 镜像源
|
||||||
export PIP_INDEX_URL=${PIP_INDEX_URL:-https://pypi.org/simple}
|
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 "mise version: $(mise --version 2>/dev/null | head -n 1)"
|
||||||
log "python: $(python --version 2>&1 | head -n 1) at $(which python)"
|
[ -x "$(command -v python)" ] && log "python: $(python --version 2>&1 | head -n 1) at $(which python)" || log "python: not installed"
|
||||||
log "node: $(node --version 2>&1 | head -n 1) at $(which node)"
|
[ -x "$(command -v node)" ] && log "node: $(node --version 2>&1 | head -n 1) at $(which node)" || log "node: not installed"
|
||||||
log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)"
|
[ -x "$(command -v npm)" ] && log "npm: $(npm --version 2>&1 | head -n 1) at $(which npm)" || log "npm: not installed"
|
||||||
|
|
||||||
# ============================
|
# ============================
|
||||||
# 将 baihu 注册到全局命令
|
# 将 baihu 注册到全局命令
|
||||||
|
|||||||
Reference in New Issue
Block a user