Update .gitea/workflows/dockerbuild.yml
Some checks failed
Build and Push Docker Image / build (push) Failing after 11s

This commit is contained in:
2025-11-12 21:33:15 +00:00
parent f98429b4f2
commit 5d1c2a266b

View File

@@ -1,60 +1,37 @@
name: Debug and Fix Docker Permissions name: Build and Push Docker Image
on: on:
push: push:
branches: [ main ] branches: [ main ]
jobs: jobs:
debug: build:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v5
- name: Debug Initial State - name: Add User to Docker Group and Refresh
run: | run: |
echo "=== Initial Debug ==="
whoami
id
groups
ls -la /var/run/docker.sock
sudo systemctl status docker
- name: Setup Docker
run: |
echo "=== Setting up Docker ==="
sudo apt-get update
sudo apt-get install -y docker.io
sudo systemctl start docker
sudo systemctl enable docker
# Add user to docker group
sudo usermod -aG docker ${{ github.actor }} sudo usermod -aG docker ${{ github.actor }}
echo "Current user groups: $(groups)"
# Fix socket permissions # Refresh the group membership for the current shell
if [ -S /var/run/docker.sock ]; then newgrp docker << 'EOF'
sudo chmod 666 /var/run/docker.sock echo "Testing with new group membership..."
fi
echo "=== After Setup ==="
groups
ls -la /var/run/docker.sock
- name: Test Docker Access
run: |
echo "=== Testing Docker Access ==="
# This should work now
docker --version
docker info docker info
EOF
# Test with sudo as fallback
sudo docker info - name: Login to Registry
uses: docker/login-action@v3
# Test with hello-world with:
sudo docker run --rm hello-world registry: git.phyllo.me
username: ${{ secrets.REGISTRY_USER }}
- name: Final Verification password: ${{ secrets.REGISTRY_PASSWORD }}
run: |
echo "=== Final Verification ===" - name: Build and Push Docker Image
echo "User: $USER" uses: docker/build-push-action@v6
echo "Groups: $(groups)" with:
echo "Docker version: $(docker --version)" context: .
echo "Docker info (should work):" push: true
docker info | head -5 tags: |
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-${{ github.sha }}
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-latest
build-args: |
BUILD_IDENTIFIER=${{ github.sha }}