Image Management
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... }}[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.
Currently, we support images stored in the Cloudflare managed registry at registry.cloudflare.com and in Amazon ECR ↗.
Support for additional external registries is coming soon.
If you wish to use a pre-built image from another registry provider, 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:
npx wrangler containers push <image>:<tag>yarn wrangler containers push <image>:<tag>pnpm 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:
npx wrangler containers build -p -t <tag> .yarn wrangler containers build -p -t <tag> .pnpm 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... }}[containers]image = "registry.cloudflare.com/your-account-id/your-image:tag"To use container images stored in Amazon ECR ↗, you will need to configure the ECR registry domain with credentials.
These credentials get stored in Secrets Store under the containers scope.
When we prepare your container, these credentials will be used to generate an ephemeral token that can pull your image.
We do not currently support public ECR images.
To generate the necessary credentials for ECR, you will need to create an IAM user with a read-only policy.
The following example grants access to all image repositories under AWS account 123456789012 in us-east-1.
{ "Version": "2012-10-17", "Statement": [ { "Action": ["ecr:GetAuthorizationToken"], "Effect": "Allow", "Resource": "*" }, { "Effect": "Allow", "Action": [ "ecr:BatchCheckLayerAvailability", "ecr:GetDownloadUrlForLayer", "ecr:BatchGetImage" ], // arn:${Partition}:ecr:${Region}:${Account}:repository/${Repository-name} "Resource": [ "arn:aws:ecr:us-east-1:123456789012:repository/*" // "arn:aws:ecr:us-east-1:123456789012:repository/example-repo", ] } ]}You can then use the credentials for the IAM User to configure a registry in wrangler. Wrangler will prompt you to create a Secrets Store store if one does not already exist, and then create your secret.
npx wrangler containers registries configure 123456789012.dkr.ecr.us-east-1.amazonaws.com --aws-access-key-id=AKIAIOSFODNN7EXAMPLEyarn wrangler containers registries configure 123456789012.dkr.ecr.us-east-1.amazonaws.com --aws-access-key-id=AKIAIOSFODNN7EXAMPLEpnpm wrangler containers registries configure 123456789012.dkr.ecr.us-east-1.amazonaws.com --aws-access-key-id=AKIAIOSFODNN7EXAMPLEOnce this is setup, you will be able to use ECR images in your wrangler config.
{ "containers": { "image": "123456789012.dkr.ecr.us-east-1.amazonaws.com/example-repo:tag" // ...rest of config... }}[containers]image = "123456789012.dkr.ecr.us-east-1.amazonaws.com/example-repo:tag"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.
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.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Directory
- 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