Some checks failed
Build and Push Docker Image / build (push) Failing after 4s
Root cause: Gitea act_runner mounts Docker socket but doesn't include Docker CLI by default to keep the image lightweight. Solution: Install docker-ce-cli package before running any docker commands. This allows the workflow to communicate with the Docker daemon via the mounted socket. Changes: - Add step to install Docker CLI from official Docker repository - Verify installation with docker version - Continue with login, build, and push steps Based on Zen expert analysis of the runner environment. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
48 lines
1.6 KiB
YAML
48 lines
1.6 KiB
YAML
name: Build and Push Docker Image
|
|
|
|
on:
|
|
push:
|
|
branches:
|
|
- main
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Install Docker CLI
|
|
run: |
|
|
sudo apt-get update
|
|
sudo apt-get install -y ca-certificates curl
|
|
sudo install -m 0755 -d /etc/apt/keyrings
|
|
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
|
|
sudo chmod a+r /etc/apt/keyrings/docker.asc
|
|
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
|
|
sudo apt-get update
|
|
sudo apt-get install -y docker-ce-cli
|
|
|
|
- name: Verify Docker installation
|
|
run: docker version
|
|
|
|
- name: Log in to Gitea Container Registry
|
|
run: |
|
|
echo "${{ secrets.GITHUB_TOKEN }}" | docker login code.puffinoffset.com -u ${{ github.actor }} --password-stdin
|
|
|
|
- name: Build Docker image
|
|
run: |
|
|
docker build -t code.puffinoffset.com/matt/puffin-app:latest \
|
|
-t code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }} \
|
|
.
|
|
|
|
- name: Push Docker images
|
|
run: |
|
|
docker push code.puffinoffset.com/matt/puffin-app:latest
|
|
docker push code.puffinoffset.com/matt/puffin-app:main-${{ github.sha }}
|
|
|
|
- name: Show image info
|
|
run: |
|
|
docker images | grep puffin-app
|