Skip to content

try pulling an image even if docker login fails#11360

Merged
emily-shen merged 3 commits intomainfrom
emily/vite-external-registries
Dec 1, 2025
Merged

try pulling an image even if docker login fails#11360
emily-shen merged 3 commits intomainfrom
emily/vite-external-registries

Conversation

@emily-shen
Copy link
Contributor

@emily-shen emily-shen commented Nov 20, 2025

Fixes CC-6472

Previously the only image registry allowed was the cloudflare managed one, and the only way to auth with that was to query the containers api for credentials. So we always did that before pulling an image. The vite plugin (for various reasons) couldn't call that api, so registry uris didn't work at all with the vite plugin.

Now we support some external registries, which users could authenticate with directly using docker login, so let's try pulling the image anyway even if calling our API fails. The API might return (short-lived) credentials for external registries if this has been previously configured via wrangler contaienrs registries configure, so it is worth trying to call it still.

The cloudflare-managed registry still wont work with the vite plugin as the only way to get credentials for that is via our API, so this PR also adds a more helpful error message in that case.

Also note that I'm not sure if it is worth adding CI tests for this, since it would involve having to set up a wrangler AWS or dockerhub account to run those tests, and storing secrets for that on this github repo, and introducing a likely spot for flakes.

However, i have tested this manually by:

  1. pointing a wrangler config to an ECR image
  2. logging in using docker login
  3. running wrangler dev and vite dev

  • Tests
    • Tests included
    • Tests not necessary because: see description
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: bugfix
  • Wrangler V3 Backport
    • Wrangler PR:
    • Not necessary because: containers

@changeset-bot
Copy link

changeset-bot bot commented Nov 20, 2025

🦋 Changeset detected

Latest commit: 6e84a34

The changes in this PR will be included in the next version bump.

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@pkg-pr-new
Copy link

pkg-pr-new bot commented Nov 20, 2025

create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@11360

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@11360

miniflare

npm i https://pkg.pr.new/miniflare@11360

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@11360

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@11360

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@11360

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@11360

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@11360

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@11360

wrangler

npm i https://pkg.pr.new/wrangler@11360

commit: 6e84a34

@emily-shen emily-shen marked this pull request as ready for review November 20, 2025 15:10
@emily-shen emily-shen requested a review from a team November 20, 2025 15:10
@emily-shen emily-shen requested review from a team as code owners November 20, 2025 15:10
@emily-shen emily-shen force-pushed the emily/vite-external-registries branch from 2051fd5 to ccb2f18 Compare November 26, 2025 15:58
@emily-shen emily-shen force-pushed the emily/vite-external-registries branch from ccb2f18 to 7f306a9 Compare November 26, 2025 16:14
@github-project-automation github-project-automation bot moved this from Untriaged to Approved in workers-sdk Nov 26, 2025
Co-authored-by: Edmund Hung <edmund@cloudflare.com>
@emily-shen emily-shen merged commit 6b38532 into main Dec 1, 2025
33 of 37 checks passed
@emily-shen emily-shen deleted the emily/vite-external-registries branch December 1, 2025 15:30
@github-project-automation github-project-automation bot moved this from Approved to Done in workers-sdk Dec 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants