revert(ci): remove docker-build, acknowledge Forgejo limitations
After extensive testing, confirmed that Docker builds are not possible in Forgejo CI due to network isolation: Tested approaches: ❌ Socket mount (/var/run/docker.sock) ❌ DinD service with TCP ❌ Buildx with various configs ❌ Direct host Docker access ❌ runs-on:docker without container Root cause: Forgejo act runner creates isolated networks for each job. No way to access Docker daemon from within these networks. Solution: Handle Docker builds separately via deployment scripts. This is a pragmatic solution that works within Forgejo's infrastructure. CI focuses on what it can do well: code quality checks.
This commit is contained in:
parent
1ebe079de7
commit
46695ae2a0
1 changed files with 16 additions and 42 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: Lint, Build, and Docker
|
||||
name: Lint and Build
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -95,45 +95,19 @@ jobs:
|
|||
run: cargo build --release --verbose
|
||||
|
||||
# ==============================================================================
|
||||
# Job 4: Docker Build - Try accessing host Docker via DOCKER_HOST
|
||||
# NOTE: Docker builds are handled separately due to Forgejo runner limitations
|
||||
#
|
||||
# The Forgejo act runner creates isolated networks for each job, making it
|
||||
# impossible to access Docker from within CI jobs. All attempts to work around
|
||||
# this have failed:
|
||||
# - Socket mount: Socket not accessible in container
|
||||
# - DinD service: DNS resolution fails across networks
|
||||
# - Buildx: Same network isolation issues
|
||||
# - Direct host access: Network isolation prevents this
|
||||
#
|
||||
# Docker builds are done separately:
|
||||
# - Locally: docker build -f backend/docker/Dockerfile
|
||||
# - On Solaria: docs/deployment/deploy-to-solaria.sh
|
||||
#
|
||||
# This is a pragmatic solution that works within Forgejo's infrastructure.
|
||||
# ==============================================================================
|
||||
docker-build:
|
||||
runs-on: docker
|
||||
needs: [build]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Try accessing Docker
|
||||
run: |
|
||||
echo "Checking Docker availability..."
|
||||
# Try various Docker host options
|
||||
if docker info >/dev/null 2>&1; then
|
||||
echo "✅ Docker accessible via default socket"
|
||||
elif docker -H unix:///var/run/docker.sock info >/dev/null 2>&1; then
|
||||
echo "✅ Docker accessible via /var/run/docker.sock"
|
||||
export DOCKER_HOST=unix:///var/run/docker.sock
|
||||
elif docker -H tcp://127.0.0.1:2375 info >/dev/null 2>&1; then
|
||||
echo "✅ Docker accessible via TCP localhost"
|
||||
export DOCKER_HOST=tcp://127.0.0.1:2375
|
||||
elif docker -H tcp://172.17.0.1:2375 info >/dev/null 2>&1; then
|
||||
echo "✅ Docker accessible via Docker bridge"
|
||||
export DOCKER_HOST=tcp://172.17.0.1:2375
|
||||
else
|
||||
echo "❌ Docker not accessible"
|
||||
echo "Available network interfaces:"
|
||||
ip addr show
|
||||
exit 1
|
||||
fi
|
||||
|
||||
- name: Show Docker version
|
||||
run: docker version
|
||||
|
||||
- name: Build Docker image
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
docker build -f docker/Dockerfile -t normogen-backend:${{ github.sha }} -t normogen-backend:latest .
|
||||
|
||||
- name: Show images
|
||||
run: docker images normogen-backend
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue