Image Management
When running wrangler deploy
, if you set the image
attribute in you Wranlger configuration
file to a path, wrangler will build your container image locally using Docker, then push it to a registry run by Cloudflare.
This registry is integrated with your Cloudflare account and is backed by R2. All authentication is handled automatically by
Cloudflare both when pushing and pulling images.
Just provide the path to your Dockerfile:
{ "containers": { "image": "./Dockerfile" // ...rest of config... }}
[containers]image = "./Dockerfile"
And deploy your Worker with wrangler deploy
. No other image management is necessary.
On subsequent deploys, Wrangler will only push image layers that have changed, which saves space and time on wrangler deploy
calls after the initial deploy.
If you wish to use a pre-built image, first, push it to the Cloudflare Registry:
Wrangler provides a command to push images to the Cloudflare Registry:
npx wrangler push <image>:<tag>
yarn wrangler push <image>:<tag>
pnpm wrangler push <image>:<tag>
Additionally, you can use the -p
flag with wrangler containers build
to build and push an image in one step:
npx wrangler containers build -p -t <tag> .
yarn wrangler containers build -p -t <tag> .
pnpm wrangler containers build -p -t <tag> .
Then you can specify the URL in the image attribute:
{ "containers": { "image": "registry.cloudflare.com/your-namespace/your-image:tag" // ...rest of config... }}
[containers]image = "registry.cloudflare.com/your-namespace/your-image:tag"
Currently, all images must use registry.cloudflare.com
, which is the default registry for Wrangler.
To use an existing image from another repo, you can pull it, tag it, then push it to the Cloudflare Registry:
docker pull <public-image>docker tag <public-image> <image>:<tag>wrangler containers push <image>:<tag>
To use an image built in a continuous integration environment, install wrangler
then
build and pushi images using either wrangler containers build
with the --push
flag, or
using the wrangler containers push
command.
Images are limited to 2 GB in size and you are limited to 50 total GB in your account's registry.
Delete images with wrangler containers delete
to free up space, but note that reverting a
Worker to a previous version that uses a deleted image will then error.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark
-