diff --git a/.gitea/workflows/dockerbuild.yml b/.gitea/workflows/dockerbuild.yml index 51cb85c..7983668 100644 --- a/.gitea/workflows/dockerbuild.yml +++ b/.gitea/workflows/dockerbuild.yml @@ -8,70 +8,31 @@ jobs: steps: - uses: actions/checkout@v5 - - 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" - - - name: Install Docker - run: | - sudo apt-get update - sudo apt-get install -y docker.io - sudo systemctl start docker - sudo systemctl enable docker - - - name: Add User to Docker Group - run: | - echo "Adding user to docker group..." - sudo usermod -aG docker ${{ github.actor }} - echo "Current groups after modification:" - groups - - # Test the group membership - id ${{ github.actor }} - - - name: Test Docker Access - run: | - echo "=== Testing Docker Access ===" - # Test without sudo (should work after usermod) - docker --version || echo "Docker command failed" - - # Test with sudo (fallback) - sudo docker --version || echo "Sudo Docker failed" - - # Test basic Docker functionality - docker info || echo "Docker info failed" - - # 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 - - - name: Setup Docker - run: | - sudo apt-get update - sudo apt-get install -y docker.io - sudo systemctl start docker - sudo systemctl enable docker - sudo usermod -aG docker $user + - name: Detailed Debug Info + run: | + # 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 + + # 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 + + # Check user membership + echo "User membership:" + groups $USER - name: Login to Registry uses: docker/login-action@v3