🔧 为 runner preset 显式设置系统 hostname
Ubuntu System Information / show-system-info (push) Successful in 0s Details

This commit is contained in:
csh 2026-05-22 10:31:22 +08:00
parent 61e512c2ae
commit 173526be79
4 changed files with 10 additions and 0 deletions

View File

@ -2,6 +2,7 @@ services:
gitea-runner:
build: .
container_name: gitea-runner-buildx-archlinux
hostname: arch
restart: unless-stopped
network_mode: "host" # 使用宿主机网络
privileged: true # Buildx 需要 privileged 模式

View File

@ -2,6 +2,7 @@ services:
gitea-runner:
build: .
container_name: gitea-runner-buildx-ubuntu-22
hostname: ubuntu
restart: unless-stopped
network_mode: "host" # 使用宿主机网络
privileged: true # Buildx 需要 privileged 模式

View File

@ -2,6 +2,7 @@ services:
gitea-runner:
build: .
container_name: gitea-runner-standard-ubuntu-22
hostname: ubuntu
restart: unless-stopped
network_mode: "host" # 使用宿主机网络
volumes:

View File

@ -81,6 +81,12 @@ test_readme_is_navigation_focused() {
grep -q 'cp \.env\.example \.env' "${file}" || fail "README.md quick start should mention copying .env.example"
}
test_presets_define_expected_hostname() {
grep -q '^ hostname: ubuntu$' "${REPO_ROOT}/docker-runner/presets/standard-ubuntu-22/docker-compose.yml" || fail "standard preset should set hostname to ubuntu"
grep -q '^ hostname: ubuntu$' "${REPO_ROOT}/docker-runner/presets/buildx-ubuntu-22/docker-compose.yml" || fail "buildx ubuntu preset should set hostname to ubuntu"
grep -q '^ hostname: arch$' "${REPO_ROOT}/docker-runner/presets/buildx-archlinux/docker-compose.yml" || fail "buildx arch preset should set hostname to arch"
}
test_preset_env_examples_exist() {
local file
@ -101,6 +107,7 @@ test_workflow_docs_and_links_use_actual_paths
test_presets_do_not_mount_check_crlf_helper
test_runner_data_is_gitignored
test_readme_is_navigation_focused
test_presets_define_expected_hostname
test_preset_env_examples_exist
echo "template_defaults_test.sh: PASS"