fix(ci): build without BuildKit — runner has no buildx
Build and Push Docker Image / build (push) Successful in 2m6s
Build and Push Docker Image / build (push) Successful in 2m6s
The CI host builds with the legacy Docker builder (buildx/BuildKit missing on the runner). Drop the '# syntax' directive and the 'RUN --mount=type=cache' npm cache mount from the Dockerfile, and remove DOCKER_BUILDKIT=1 from the workflow. Restores a green build so registry.alwisp.com/jason/mrp-qrcode:latest publishes and PORT can roll the container off the pinned old digest.
This commit is contained in:
@@ -8,6 +8,8 @@ on:
|
||||
jobs:
|
||||
build:
|
||||
# Runs on the forgerunner host: bundled Docker CLI + mounted /var/run/docker.sock.
|
||||
# The host builds with the legacy Docker builder (buildx/BuildKit is not installed
|
||||
# on the runner), so the Dockerfile avoids BuildKit-only features.
|
||||
runs-on: host
|
||||
steps:
|
||||
- name: Checkout
|
||||
@@ -25,13 +27,6 @@ jobs:
|
||||
password: ${{ secrets.REGISTRY_TOKEN }}
|
||||
|
||||
- name: Build and Push
|
||||
env:
|
||||
# This Dockerfile uses BuildKit features (`# syntax=docker/dockerfile:1.7`
|
||||
# and `RUN --mount=type=cache`). Without this the CLI falls back to the
|
||||
# legacy builder, which ignores the syntax directive and fails at the first
|
||||
# `--mount`. DOCKER_BUILDKIT=1 activates dockerd's integrated BuildKit
|
||||
# backend (no separate buildx plugin required).
|
||||
DOCKER_BUILDKIT: "1"
|
||||
run: |
|
||||
IMAGE="registry.alwisp.com/${{ gitea.repository }}"
|
||||
GIT_SHA="$(git rev-parse --short HEAD)"
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
# syntax=docker/dockerfile:1.7
|
||||
|
||||
# --- deps ------------------------------------------------------------------
|
||||
FROM node:20-alpine AS deps
|
||||
WORKDIR /app
|
||||
RUN apk add --no-cache openssl libc6-compat
|
||||
COPY package.json package-lock.json* ./
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
# Plain RUN (no BuildKit cache mount): the CI host builds with the legacy Docker
|
||||
# builder — buildx/BuildKit is not available on the runner — so `--mount=type=cache`
|
||||
# is not supported here.
|
||||
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
|
||||
|
||||
# --- build -----------------------------------------------------------------
|
||||
FROM node:20-alpine AS builder
|
||||
|
||||
Reference in New Issue
Block a user