fix: use Docker CLI with host daemon instead of buildah

- buildah requires user namespaces which aren't available in containers
- Use Docker CLI with host's Docker socket (already mounted by runner)
- Keep Alpine base and optimizations (git clone, sh shell)
- Simplest solution for containerized Kubernetes runners

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2026-03-06 03:09:37 +00:00
parent 08444b41a8
commit 1067ffa35a
+8 -8
View File
@@ -15,7 +15,7 @@ jobs:
- name: Install dependencies - name: Install dependencies
shell: sh shell: sh
run: | run: |
apk add --no-cache git buildah fuse-overlayfs apk add --no-cache git docker-cli
- name: Checkout code - name: Checkout code
shell: sh shell: sh
@@ -68,21 +68,21 @@ jobs:
- name: Login to registry - name: Login to registry
shell: sh shell: sh
run: | run: |
echo "${{ secrets.PERSONAL_TOKEN }}" | buildah login --username "${{ gitea.actor }}" --password-stdin gitea.leeworks.dev echo "${{ secrets.PERSONAL_TOKEN }}" | docker login gitea.leeworks.dev -u "${{ gitea.actor }}" --password-stdin
- name: Build and push with buildah - name: Build and push with Docker
shell: sh shell: sh
run: | run: |
echo "Building image with buildah..." echo "Building image..."
buildah bud -t ${{ steps.tags.outputs.IMAGE_TAG }} . docker build -t ${{ steps.tags.outputs.IMAGE_TAG }} .
echo "Pushing image..." echo "Pushing image..."
buildah push ${{ steps.tags.outputs.IMAGE_TAG }} docker push ${{ steps.tags.outputs.IMAGE_TAG }}
if [ "${{ steps.tags.outputs.PUSH_LATEST }}" = "true" ]; then if [ "${{ steps.tags.outputs.PUSH_LATEST }}" = "true" ]; then
echo "Tagging and pushing latest..." echo "Tagging and pushing latest..."
buildah tag ${{ steps.tags.outputs.IMAGE_TAG }} ${{ steps.tags.outputs.IMAGE_LATEST }} docker tag ${{ steps.tags.outputs.IMAGE_TAG }} ${{ steps.tags.outputs.IMAGE_LATEST }}
buildah push ${{ steps.tags.outputs.IMAGE_LATEST }} docker push ${{ steps.tags.outputs.IMAGE_LATEST }}
fi fi
echo "Build and push completed successfully!" echo "Build and push completed successfully!"