Skip to content

Instantly share code, notes, and snippets.

@bisgardo
Created February 19, 2023 12:24
Show Gist options
  • Save bisgardo/de9efee5405766e560c9b855d343bfdf to your computer and use it in GitHub Desktop.
Save bisgardo/de9efee5405766e560c9b855d343bfdf to your computer and use it in GitHub Desktop.
Dockerfile for building Cloudflare Wrangler CLI
# Run from root of freshly cloned 'https://github.com/cloudflare/workers-sdk'.
FROM debian:bookworm-slim
RUN apt-get update && apt-get -y install npm libc++1 && rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN npm install
WORKDIR /app/packages/wrangler
RUN npm install
RUN npm run build
@bisgardo
Copy link
Author

Can extract fully built repo using

docker run --rm -v $PWD/out:/out cloudflare:worker cp -Tr /app /out

and then run the CLI from ./out/packages/wrangler using

node wrangler-dist/cli.js <args>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment