You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
No way to attach a container to a Durable Object declared on an async (non-Effect) Worker #953
Our Worker is a plain async module. It hosts a container-backed Durable Object whose class comes from an npm package (@cloudflare/sandbox's Sandbox), re-exported from the Worker entrypoint. We declare it the async way:
This uploads the DO namespace binding and the new_sqlite_classes migration, but the script metadata never gets a containers: [{ className: "Sandbox" }] entry, so Cloudflare does not treat the class as container-backed.
Why it appears unsupported (2.0.0-beta.64 source)
WorkerAsyncBindings.ts has no container branch — nothing in the async env path can contribute containers binding data.
The only producer of that data is ContainerPlatform.bind (ContainerPlatform.ts:137-139), which requires the Effect-native DurableObjectScope — unreachable for a plain async DO class from an npm package.
WorkerProvider derives metadata.containers exclusively from bindings data (WorkerProvider.ts:1717-1722, :1851-1855), so there is no prop-level escape.
Separately, ContainerProvider always docker pulls and re-pushes (ContainerProvider.ts:314-324; the create path is unguarded at :936) even when image is a digest reference already in the account's registry.cloudflare.com — no skip path for pre-pushed images.
Feature request
Let async Workers declare a container-backed DO, e.g. Cloudflare.DurableObject<Sandbox>("Sandbox", { container: SandboxContainer }) or container handling in the async env binding path.
Skip the Docker round-trip when image is a digest reference that already exists in the target registry (or offer push: false).
Workaround we found
worker.bind() with raw { containers: [{ className, dev: undefined }] } binding data, plus managing the ContainerApplication out-of-band. It works, but it leans on undocumented binding internals.
Context: this came up migrating a seven-Worker production app (Cloudflare-native, async Workers throughout) to Alchemy v2. Happy to test a fix or expand on any of the source references.
Activity
test(cloudflare/containers): deploy the #1321 container-binding shape