Fix pipeline: use node image with docker CLI installed
Some checks failed
Build and push image / build-and-push (push) Failing after 24s
Some checks failed
Build and push image / build-and-push (push) Failing after 24s
JS actions (checkout, login-action, etc.) need Node.js, so the docker CLI-only alpine image couldn't run them. Switch to node:20-bookworm and install the docker CLI/buildx plugin as a step instead. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
parent
340fc8ba57
commit
8f3138a202
1 changed files with 17 additions and 4 deletions
|
|
@ -8,10 +8,11 @@ on:
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push:
|
||||||
runs-on: docker
|
runs-on: docker
|
||||||
# The default job image has no docker CLI, so run in an image that has
|
# actions/checkout & co. are JS actions and need Node, so the job
|
||||||
# one and talk to a sidecar dind daemon over the network instead of
|
# container has to be a Node image (not a bare docker CLI image). We
|
||||||
# relying on the runner exposing a host docker socket.
|
# install the Docker CLI into it and talk to a sidecar dind daemon over
|
||||||
container: docker:27-cli
|
# the network instead of relying on the runner exposing a host socket.
|
||||||
|
container: node:20-bookworm
|
||||||
services:
|
services:
|
||||||
docker:
|
docker:
|
||||||
image: docker:27-dind
|
image: docker:27-dind
|
||||||
|
|
@ -22,6 +23,18 @@ jobs:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Install Docker CLI
|
||||||
|
run: |
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends ca-certificates curl
|
||||||
|
install -m 0755 -d /etc/apt/keyrings
|
||||||
|
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
|
||||||
|
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/debian $(. /etc/os-release && echo $VERSION_CODENAME) stable" \
|
||||||
|
> /etc/apt/sources.list.d/docker.list
|
||||||
|
apt-get update
|
||||||
|
apt-get install -y --no-install-recommends docker-ce-cli docker-buildx-plugin
|
||||||
|
|
||||||
- name: Log in to Forgejo registry
|
- name: Log in to Forgejo registry
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue