Update .gitea/workflows/dockerbuild.yml
Some checks failed
Debug Docker Permissions / debug (push) Failing after 14s

This commit is contained in:
2025-11-12 21:26:46 +00:00
parent f1ba1e0792
commit 75a497eeb8

View File

@@ -1,54 +1,58 @@
name: Build and Push Docker Image name: Debug Docker Permissions
on: on:
push: push:
branches: [ main ] branches: [ main ]
jobs: jobs:
build: debug:
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- uses: actions/checkout@v5 - uses: actions/checkout@v4
- name: Detailed Debug Info - name: Debug Environment
run: | run: |
echo "=== System Information ==="
# Check if we're in a container uname -a
echo "Running in container: ${{ contains(github.runner_os, 'Linux') }}" cat /etc/os-release
echo "=== User Information ==="
# Check file permissions whoami
echo "Docker socket permissions:" id
ls -la /var/run/docker.sock groups
echo "=== Docker Setup ==="
# Check if docker group exists which docker || echo "Docker not installed"
echo "Docker group info:" sudo systemctl status docker || echo "Docker service not running"
getent group docker echo "=== Docker Socket ==="
ls -la /var/run/docker.sock || echo "No docker socket found"
# Check if we can run docker commands
echo "Testing docker commands:"
if command -v docker &> /dev/null; then - name: Add User to Docker Group
echo "Docker is installed" run: |
docker --version echo "Adding user to docker group..."
else sudo usermod -aG docker $USER
echo "Docker not installed" echo "Current groups after modification:"
fi groups
# Check user membership
echo "User membership:" - name: Test Docker Access
groups $USER run: |
echo "=== Testing Docker Access ==="
- name: Login to Registry # Test without sudo (should work after usermod)
uses: docker/login-action@v3 docker --version || echo "Docker command failed"
with:
registry: git.phyllo.me # Test with sudo (fallback)
username: ${{ secrets.REGISTRY_USER }} sudo docker --version || echo "Sudo Docker failed"
password: ${{ secrets.REGISTRY_PASSWORD }}
# Test basic Docker functionality
- name: Build and Push Docker Image docker info || echo "Docker info failed"
uses: docker/build-push-action@v6
with: # Test with a simple container
context: . docker run --rm hello-world || echo "Hello world test failed"
push: true
tags: | - name: Final Debug Check
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-${{ github.sha }} run: |
git.phyllo.me/devops/fedora-runner-image:${{ github.ref_name }}-latest echo "=== Final Debug Check ==="
build-args: | echo "User: $USER"
BUILD_IDENTIFIER=${{ github.sha }} echo "Groups: $(groups)"
echo "Docker version:"
docker --version
echo "Docker info:"
docker info | head -10