`gitea`的`runner`参数化,可以通过`docker-compose.yml`进行配置
Ubuntu System Information / show-system-info (push) Successful in 39s Details

🐛 修复`Dockerfile`缺少系统包
This commit is contained in:
csh 2025-12-10 14:42:20 +08:00
parent 1b5611cf3e
commit db75d0ebc5
6 changed files with 48 additions and 10 deletions

View File

@ -20,12 +20,17 @@ echo ""
# 获取注册信息并验证
while true; do
if [ -n "${GITEA_INSTANCE:-}" ]; then
echo "Using Gitea instance from env: $GITEA_INSTANCE"
else
read -p "Enter Gitea instance URL (e.g., https://gitea.example.com): " GITEA_INSTANCE
fi
# 验证 URL 格式
if [[ ! "$GITEA_INSTANCE" =~ ^https?:// ]]; then
echo "✗ Error: URL must start with http:// or https://"
echo ""
unset GITEA_INSTANCE
continue
fi
@ -35,15 +40,20 @@ while true; do
break
done
if [ -n "${GITEA_TOKEN:-}" ]; then
echo "Using registration token from env."
else
read -p "Enter registration token: " GITEA_TOKEN
fi
if [ -z "$GITEA_TOKEN" ]; then
echo "✗ Error: Token cannot be empty!"
exit 1
fi
read -p "Enter runner name (default: docker-runner): " RUNNER_NAME
RUNNER_NAME=${RUNNER_NAME:-docker-runner}
DEFAULT_NAME="${DEFAULT_RUNNER_NAME:-docker-runner}"
read -p "Enter runner name (default: $DEFAULT_NAME): " RUNNER_NAME
RUNNER_NAME=${RUNNER_NAME:-$DEFAULT_NAME}
# 多个 label逗号分隔无空格
# ubuntu-22.04:host://ubuntu:22.04,ubuntu-20.04:host://ubuntu:20.04,node:docker://node:18

View File

@ -23,16 +23,20 @@ RUN pacman -Syu --noconfirm && \
ninja \
curl \
git \
nodejs \
npm \
python \
python-pyyaml \
python-pip \
paru \
conan \
sudo \
vim \
supervisor \
qemu-user-static \
qemu-user-static-binfmt \
fakeroot \
docker \
docker-buildx \
&& pacman -Scc --noconfirm
# AUR 用户paru 需非 root 运行)
@ -43,7 +47,7 @@ RUN useradd -m aur && \
# 安装额外的 AUR 工具
USER aur
WORKDIR /home/aur
RUN paru -S --noconfirm --needed --noprogressbar llvm-mingw-w64-toolchain-ucrt-bin && \
RUN paru -S --noconfirm --needed --noprogressbar conan-bin llvm-mingw-w64-toolchain-ucrt-bin && \
paru -Scc --noconfirm && \
rm -rf ~/.cache/paru
@ -51,6 +55,10 @@ RUN paru -S --noconfirm --needed --noprogressbar llvm-mingw-w64-toolchain-ucrt-b
USER root
WORKDIR /root
# 交叉工具链可用:确保 windres 在 PATH避免 CMake 查找失败
ENV PATH="/opt/llvm-mingw/llvm-mingw-ucrt/bin:${PATH}"
ENV RC="/opt/llvm-mingw/llvm-mingw-ucrt/bin/x86_64-w64-mingw32-windres"
# 验证 qemu 和 docker 安装
RUN qemu-aarch64-static --version && \
qemu-x86_64-static --version && \

View File

@ -20,6 +20,9 @@ services:
# Arch Linux Buildx 配置 - 使用 tonistiigi/binfmt
- ENABLE_BUILDX=true
- BINFMT_METHOD=tonistiigi
- GITEA_INSTANCE=https://git.mytsl.cn
- GITEA_TOKEN=
- DEFAULT_RUNNER_NAME=buildx-archlinux
- DEFAULT_RUNNER_LABEL=archlinux:host://archlinux:latest,company-server:host://archlinux:latest,buildx-archlinux:host://archlinux:latest
# 如果需要使用代理,取消下面的注释并修改为你的代理地址

View File

@ -15,12 +15,24 @@ RUN apt-get update && apt-get install -y \
lsb-release \
qemu-user-static \
binfmt-support \
apt-transport-https \
&& rm -rf /var/lib/apt/lists/*
# 安装 Docker包含 Buildx 插件)
RUN curl -fsSL https://get.docker.com -o get-docker.sh && \
sh get-docker.sh && \
rm get-docker.sh
RUN install -m 0755 -d /etc/apt/keyrings && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg && \
chmod a+r /etc/apt/keyrings/docker.gpg && \
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" > /etc/apt/sources.list.d/docker.list && \
apt-get update && \
apt-get install -y \
docker-ce \
docker-ce-cli \
containerd.io \
docker-buildx-plugin \
docker-compose-plugin \
&& rm -rf /var/lib/apt/lists/*
# 验证安装
RUN docker --version && \

View File

@ -19,7 +19,9 @@ services:
# Buildx 配置 - 启用多架构构建
- ENABLE_BUILDX=true
- BINFMT_METHOD=update-binfmts
- GITEA_INSTANCE=https://git.mytsl.cn
- GITEA_TOKEN=
- DEFAULT_RUNNER_NAME=buildx-ubuntu-22
- DEFAULT_RUNNER_LABEL=ubuntu-22.04:host://ubuntu:22.04,company-server:host://ubuntu:22.04,buildx-ubuntu-22:host://ubuntu:22.04
# 如果需要使用代理,取消下面的注释并修改为你的代理地址

View File

@ -17,6 +17,9 @@ services:
# Standard 配置 - 不启用 Buildx
- ENABLE_BUILDX=false
- GITEA_INSTANCE=https://git.mytsl.cn
- GITEA_TOKEN=
- DEFAULT_RUNNER_NAME=standard-ubuntu-22
- DEFAULT_RUNNER_LABEL=ubuntu-22.04:host://ubuntu:22.04,company-server:host://ubuntu:22.04,standard-ubuntu-22:host://ubuntu:22.04
# 如果需要使用代理,取消下面的注释并修改为你的代理地址