Use host.docker.internal:3300 for checkout instead of gitea:3000

Job containers are on their own bridge networks and can't reach
172.21.0.4 (Gitea's IP on gitea_gitea network). Use the Docker host
gateway with port 3300 (which maps to Gitea container's 3000) instead.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
Gan, Jimmy
2026-06-03 03:53:25 +08:00
parent ab24bd8526
commit 9e72e8abdf
+3 -7
View File
@@ -21,10 +21,8 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
run: | run: |
# Runner DNS overrides bypass Docker's embedded DNS; add gitea to hosts
grep -q gitea /etc/hosts || echo "172.21.0.4 gitea" >> /etc/hosts
if [ ! -d .git ]; then if [ ! -d .git ]; then
git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . git clone --depth=1 "http://host.docker.internal:3300/${GITHUB_REPOSITORY}.git" .
fi fi
- name: Setup Python - name: Setup Python
@@ -109,9 +107,8 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
run: | run: |
grep -q gitea /etc/hosts || echo "172.21.0.4 gitea" >> /etc/hosts
if [ ! -d .git ]; then if [ ! -d .git ]; then
git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . git clone --depth=1 "http://host.docker.internal:3300/${GITHUB_REPOSITORY}.git" .
fi fi
- name: Setup Node.js - name: Setup Node.js
@@ -188,9 +185,8 @@ jobs:
steps: steps:
- name: Checkout repository - name: Checkout repository
run: | run: |
grep -q gitea /etc/hosts || echo "172.21.0.4 gitea" >> /etc/hosts
if [ ! -d .git ]; then if [ ! -d .git ]; then
git clone --depth=1 "http://gitea:3000/${GITHUB_REPOSITORY}.git" . git clone --depth=1 "http://host.docker.internal:3300/${GITHUB_REPOSITORY}.git" .
fi fi
- name: Warm mirror cache for base images - name: Warm mirror cache for base images