1
0
Fork 0
1Panel-Appstore/apps/forgejo-runner/12.6.3-dind/scripts/init.sh

48 lines
943 B
Bash
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.

#!/bin/bash
set -e
mkdir -p data
cd data
## ----------------------------
## Runner 数据目录及权限设置
## ----------------------------
mkdir -p runner-data
touch runner-data/.runner
touch runner-data/config.yml
mkdir -p runner-data/.cache
# 设置权限为 forgejo-runner 镜像中默认用户UID 1000
chown -R 1000:1000 runner-data
chmod 775 runner-data/.runner
chmod 775 runner-data/.cache
chmod g+s runner-data/.runner
chmod g+s runner-data/.cache
## ----------------------------
## Docker-in-Docker 数据目录
## ----------------------------
mkdir -p dind-data
## ----------------------------
## daemon.json 镜像加速配置
## ----------------------------
if [ -f /etc/docker/daemon.json ]; then
cp /etc/docker/daemon.json ./daemon.json
else
cat > ./daemon.json <<EOF
{
"registry-mirrors": [
"https://docker.1panel.live",
"https://docker.1ms.run"
]
}
EOF
fi
cd ..
chmod +x ./scripts/register.sh