diff --git a/pnpm/Dockerfile b/pnpm/Dockerfile new file mode 100644 index 000000000..3f7fb0cb4 --- /dev/null +++ b/pnpm/Dockerfile @@ -0,0 +1,3 @@ +FROM node:18-alpine + +RUN corepack enable && corepack prepare pnpm@latest --activate \ No newline at end of file diff --git a/pnpm/README.md b/pnpm/README.md new file mode 100644 index 000000000..2b96f51e9 --- /dev/null +++ b/pnpm/README.md @@ -0,0 +1,23 @@ +# pnpm builder for Google Cloud Build + +This image can be used in Google Cloud Run to have access to `pnpm`. + +## Submit the image to your project + +```bash +gcloud builds submit --tag gcr.io//pnpm-builder +``` + +## Example usage on a `cloudbuild.yaml` + +```yaml +steps: + - id: install + name: gcr.io/$PROJECT_ID/pnpm-builder + entrypoint: pnpm + args: ['install', '--frozen-lockfile'] + - id: test + name: gcr.io/$PROJECT_ID/pnpm-builder + entrypoint: pnpm + args: ['run', 'test'] +``` diff --git a/pnpm/cloudbuild.yaml b/pnpm/cloudbuild.yaml new file mode 100644 index 000000000..e073dd35a --- /dev/null +++ b/pnpm/cloudbuild.yaml @@ -0,0 +1,6 @@ +steps: + - name: 'gcr.io/cloud-builders/docker' + args: ['build', '-t','gcr.io/$PROJECT_ID/pnpm-builder','.'] + +images: + - gcr.io/$PROJECT_ID/pnpm-builder