How to enable BuildKit?
NatoBoram opened this issue · comments
Nato Boram commented
TL;DR
I want to use BuildKit when using gcloud builds submit
.
Expected behavior
gcloud builds submit
should run without issues
Observed behavior
Step 8/16 : RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
Action YAML
name: Deploy Cloud Run
on:
push:
branches:
- main
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v3
- uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.GOOGLECLOUDSA }}"
- uses: google-github-actions/setup-gcloud@v1
with:
version: ">= 363.0.0"
- run: gcloud info
- name: Deploy to dev
run: |
gcloud builds submit --tag gcr.io/[org/project]
gcloud run deploy [project] --image gcr.io/[org/project] --region us-central1 --allow-unauthenticated --vpc-connector=[something]
env:
DOCKER_BUILDKIT: 1
Log output
Step 1/16 : FROM node:20-slim AS base
20-slim: Pulling from library/node
578acb154839: Already exists
f3a2b77f9928: Pulling fs layer
a85b2b0d2bb1: Pulling fs layer
a00d5f033cfe: Pulling fs layer
34bf1b6c36c0: Pulling fs layer
34bf1b6c36c0: Waiting
f3a2b77f9928: Verifying Checksum
f3a2b77f9928: Download complete
a00d5f033cfe: Download complete
f3a2b77f9928: Pull complete
34bf1b6c36c0: Verifying Checksum
34bf1b6c36c0: Download complete
a85b2b0d2bb1: Verifying Checksum
a85b2b0d2bb1: Download complete
a85b2b0d2bb1: Pull complete
a00d5f033cfe: Pull complete
34bf1b6c36c0: Pull complete
Digest: sha256:da981564279232f7962576d79d01832cc12f8270e8ddd05bb3077af8061a50ca
Status: Downloaded newer image for node:20-slim
---> 15a6f68731d6
Step 2/16 : ENV PNPM_HOME="/pnpm"
---> Running in 45a0d4996142
Removing intermediate container 45a0d4996142
---> 08e333a4ed9f
Step 3/16 : ENV PATH="$PNPM_HOME:$PATH"
---> Running in 270403f27f68
Removing intermediate container 270403f27f68
---> 74bbaacd2f31
Step 4/16 : RUN corepack enable
---> Running in 0c4b32c80873
Removing intermediate container 0c4b32c80873
---> 9ba9cba7608d
Step 5/16 : COPY . /app
---> 6efdc1196e2a
Step 6/16 : WORKDIR /app
---> Running in 11e1945cca86
Removing intermediate container 11e1945cca86
---> 0f14e737ca18
Step 7/16 : FROM base AS prod-deps
---> 0f14e737ca18
Step 8/16 : RUN --mount=type=cache,id=pnpm,target=/pnpm/store pnpm install --prod --frozen-lockfile
the --mount option requires BuildKit. Refer to https://docs.docker.com/go/buildkit/ to learn how to build images with BuildKit enabled
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/docker" failed: step exited with non-zero status: 1
--------------------------------------------------------------------------------
Error: Process completed with exit code 1.
Additional information
No response
Seth Vargo commented
Hi @NatoBoram - thank you for opening an issue. This appears to be a generic question about Google Cloud Build. Please open an issue or use the community support options at https://cloud.google.com/build/docs/getting-support.