Skip to content
Cloudflare Docs

Image Management

Pushing images during wrangler deploy

When running wrangler deploy, if you set the image attribute in your Wrangler configuration to a path to a Dockerfile, 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...
}
}

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.

Using pre-built container images

Currently, all images must use registry.cloudflare.com.

If you wish to use a pre-built image, first, make sure it exists locally, then push it to the Cloudflare Registry:

docker pull <public-image>
docker tag <public-image> <image>:<tag>

Wrangler provides a command to push images to the Cloudflare Registry:

Terminal window
npx wrangler containers push <image>:<tag>

Or, you can use the -p flag with wrangler containers build to build and push an image in one step:

Terminal window
npx wrangler containers build -p -t <tag> .

This will output an image registry URI that you can then use in your Wrangler configuration:

{
"containers": {
"image": "registry.cloudflare.com/your-account-id/your-image:tag"
// ...rest of config...
}
}

Pushing images with CI

To use an image built in a continuous integration environment, install wrangler then build and push images using either wrangler containers build with the --push flag, or using the wrangler containers push command.

Registry Limits

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 images delete to free up space, but reverting a Worker to a previous version that uses a deleted image will then error.