Drop buildx, use plain docker build/push
Some checks failed
Build and push image / build-and-push (push) Failing after 15s

docker/setup-buildx-action resolves its builder endpoint from the
docker context file rather than the live DOCKER_HOST env var, so it
still tried the (absent) unix socket. Plain docker CLI commands
honor DOCKER_HOST directly, matching what the runner now provides.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Lucas Seidelin Rosenvold Christensen 2026-09-18 15:36:20 +02:00
parent f22e93963e
commit 73144b91aa

View file

@ -8,10 +8,11 @@ on:
jobs: jobs:
build-and-push: build-and-push:
runs-on: docker runs-on: docker
# actions/checkout & co. are JS actions and need Node, so the job # actions/checkout is a JS action and needs Node, so the job container
# container has to be a Node image (not a bare docker CLI image). The # has to be a Node image. The runner already provides a privileged
# runner already provides a privileged container wired up to its own # container wired up to its own dind sidecar via DOCKER_HOST, so we
# dind sidecar via DOCKER_HOST, so we just need the docker CLI itself. # just need the docker CLI itself. Plain `docker` commands (rather
# than buildx-based actions) pick up DOCKER_HOST directly.
container: node:20-bookworm container: node:20-bookworm
steps: steps:
- name: Checkout - name: Checkout
@ -27,24 +28,17 @@ jobs:
echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \ echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \
> /etc/apt/sources.list.d/docker.list > /etc/apt/sources.list.d/docker.list
apt-get update apt-get update
apt-get install -y --no-install-recommends docker-ce-cli docker-buildx-plugin apt-get install -y --no-install-recommends docker-ce-cli
- name: Log in to Forgejo registry - name: Log in to Forgejo registry
uses: docker/login-action@v3 run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login git.rosenvold.tech -u "${{ github.actor }}" --password-stdin
with:
registry: git.rosenvold.tech
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker Buildx - name: Build image
uses: docker/setup-buildx-action@v3 run: |
docker build \
-t git.rosenvold.tech/lucas/rosenvold-core:latest \
-t git.rosenvold.tech/lucas/rosenvold-core:${{ github.sha }} \
-f Containerfile .
- name: Build and push - name: Push image
uses: docker/build-push-action@v5 run: docker push git.rosenvold.tech/lucas/rosenvold-core --all-tags
with:
context: .
file: ./Containerfile
push: true
tags: |
git.rosenvold.tech/lucas/rosenvold-core:latest
git.rosenvold.tech/lucas/rosenvold-core:${{ github.sha }}