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