# syntax=docker/dockerfile:1 ARG NODE_VERSION=16 FROM node:${NODE_VERSION}-alpine AS base RUN apk add --no-cache cpio findutils git WORKDIR /src FROM base AS deps RUN --mount=type=bind,target=.,rw \ --mount=type=cache,target=/src/node_modules <&2 'ERROR: Vendor result differs. Please vendor your package with "docker buildx bake vendor-update"' echo "$diff" exit 1 fi EOT FROM deps AS build RUN --mount=type=bind,target=.,rw \ --mount=type=cache,target=/src/node_modules <&2 'ERROR: Build result differs. Please build first with "docker buildx bake build"' echo "$diff" exit 1 fi EOT FROM deps AS format RUN --mount=type=bind,target=.,rw \ --mount=type=cache,target=/src/node_modules <