Files
docker-files/gitea_runner_base/Dockerfile
2026-01-26 16:40:52 +08:00

60 lines
1.7 KiB
Docker
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

# Gitea Action Runner Base Image
# 基于 gitea/act_runner 添加常用构建工具,不含具体语言环境
FROM gitea/act_runner:latest
LABEL maintainer="www.imyeyu.com"
LABEL description="Gitea Action Runner with basic build tools"
# 预装常用 GitHub Actions 缓存目录
ENV ACTIONS_CACHE_DIR=/root/.cache/act
# 安装基本构建工具并预装常用 GitHub Actions
# act_runner 基于 Alpine Linux
RUN apk update && apk add --no-cache \
# 版本控制
git \
git-lfs \
# 网络工具
curl \
wget \
ca-certificates \
openssl \
# 文件传输工具
rsync \
openssh-client \
sshpass \
lftp \
# 压缩/解压工具
tar \
gzip \
bzip2 \
xz \
zip \
unzip \
# 基本构建工具
make \
bash \
coreutils \
findutils \
grep \
sed \
gawk \
# Node.js 运行时(用于运行 JavaScript actions
nodejs \
npm \
# 其他常用工具
jq \
tree \
&& rm -rf /var/cache/apk/* \
# 预装常用 GitHub Actions避免每次执行都从 GitHub clone
# 目录结构必须是 {owner}/{repo}@{ref} 格式
&& mkdir -p ${ACTIONS_CACHE_DIR}/actions \
&& cd ${ACTIONS_CACHE_DIR}/actions \
&& git clone --depth 1 --branch v4 https://github.com/actions/checkout.git checkout@v4 \
&& git clone --depth 1 --branch v4 https://github.com/actions/cache.git cache@v4 \
&& git clone --depth 1 --branch v4 https://github.com/actions/upload-artifact.git upload-artifact@v4 \
&& git clone --depth 1 --branch v4 https://github.com/actions/download-artifact.git download-artifact@v4 \
# 清理 .git 目录减少镜像体积
&& find ${ACTIONS_CACHE_DIR} -name ".git" -type d -exec rm -rf {} + 2>/dev/null || true