Update .gitea/workflows/dockerbuild.yml
Some checks failed
Debug Docker Permissions / debug (push) Failing after 14s
Some checks failed
Debug Docker Permissions / debug (push) Failing after 14s
This commit is contained in:
@@ -1,54 +1,58 @@
|
||||
name: Build and Push Docker Image
|
||||
name: Debug Docker Permissions
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
jobs:
|
||||
build:
|
||||
debug:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v5
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Detailed Debug Info
|
||||
- name: Debug Environment
|
||||
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
|
||||
echo "Docker socket permissions:"
|
||||
ls -la /var/run/docker.sock
|
||||
- name: Add User to Docker Group
|
||||
run: |
|
||||
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
|
||||
echo "Testing docker commands:"
|
||||
if command -v docker &> /dev/null; then
|
||||
echo "Docker is installed"
|
||||
docker --version
|
||||
else
|
||||
echo "Docker not installed"
|
||||
fi
|
||||
- name: Test Docker Access
|
||||
run: |
|
||||
echo "=== Testing Docker Access ==="
|
||||
# Test without sudo (should work after usermod)
|
||||
docker --version || echo "Docker command failed"
|
||||
|
||||
# Check user membership
|
||||
echo "User membership:"
|
||||
groups $USER
|
||||
# Test with sudo (fallback)
|
||||
sudo docker --version || echo "Sudo Docker failed"
|
||||
|
||||
- name: Login to Registry
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: git.phyllo.me
|
||||
username: ${{ secrets.REGISTRY_USER }}
|
||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
||||
# Test basic Docker functionality
|
||||
docker info || echo "Docker info failed"
|
||||
|
||||
- name: Build and Push Docker Image
|
||||
uses: docker/build-push-action@v6
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
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 }}
|
||||
# Test with a simple container
|
||||
docker run --rm hello-world || echo "Hello world test failed"
|
||||
|
||||
- name: Final Debug Check
|
||||
run: |
|
||||
echo "=== Final Debug Check ==="
|
||||
echo "User: $USER"
|
||||
echo "Groups: $(groups)"
|
||||
echo "Docker version:"
|
||||
docker --version
|
||||
echo "Docker info:"
|
||||
docker info | head -10
|
||||
Reference in New Issue
Block a user