feat(ci): try Buildx with runs-on:docker (no container)
- Remove container specification from docker-build job - Use 'runs-on: docker' without container to access Docker directly - This might allow direct access to host Docker daemon - Test if Buildx can work without network isolation issues
This commit is contained in:
parent
e61297d044
commit
006bcd9dde
1 changed files with 46 additions and 12 deletions
|
|
@ -1,4 +1,4 @@
|
|||
name: Lint and Build
|
||||
name: Lint, Build, and Docker
|
||||
|
||||
on:
|
||||
push:
|
||||
|
|
@ -95,15 +95,49 @@ jobs:
|
|||
run: cargo build --release --verbose
|
||||
|
||||
# ==============================================================================
|
||||
# NOTE: Docker build disabled due to DNS/network issues with DinD services
|
||||
#
|
||||
# The Forgejo runner creates temporary networks for each job, causing
|
||||
# DNS resolution issues when trying to connect to DinD services.
|
||||
#
|
||||
# Docker builds should be done separately:
|
||||
# - Locally: docker build -f backend/docker/Dockerfile -t normogen-backend:latest
|
||||
# - On Solaria: Use deployment scripts in docs/deployment/
|
||||
#
|
||||
# Future solution: Configure Forgejo runner with Docker-in-Docker properly
|
||||
# or use a container registry with proper BuildKit support.
|
||||
# Job 4: Docker Build with Buildx - Using runs-on: docker without container
|
||||
# ==============================================================================
|
||||
docker-build:
|
||||
runs-on: docker
|
||||
# No container - should have direct Docker access
|
||||
needs: [build]
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Verify Docker is available
|
||||
run: |
|
||||
docker version
|
||||
docker info
|
||||
|
||||
- name: Set up Docker Buildx
|
||||
run: |
|
||||
docker buildx version
|
||||
docker buildx create --use --name builder
|
||||
docker buildx inspect --bootstrap
|
||||
|
||||
- name: Build Docker image with Buildx
|
||||
working-directory: ./backend
|
||||
run: |
|
||||
docker buildx build \
|
||||
--file docker/Dockerfile \
|
||||
--tag normogen-backend:${{ github.sha }} \
|
||||
--tag normogen-backend:latest \
|
||||
--cache-from type=local,src=/tmp/.buildx-cache \
|
||||
--cache-to type=local,dest=/tmp/.buildx-cache-new,mode=max \
|
||||
--load \
|
||||
.
|
||||
|
||||
# Rotate cache
|
||||
rm -rf /tmp/.buildx-cache
|
||||
mv /tmp/.buildx-cache-new /tmp/.buildx-cache || true
|
||||
|
||||
- name: Test Docker image
|
||||
run: |
|
||||
docker run --rm normogen-backend:${{ github.sha }} ls -la /app/normogen-backend || echo "Binary check"
|
||||
|
||||
- name: Show image info
|
||||
run: |
|
||||
docker images normogen-backend
|
||||
docker inspect normogen-backend:${{ github.sha }} || echo "Image inspect"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue