Skip to content
Playground(another site)

bynk.container.output_outside_project

Error A build with a Container is written to an output directory outside the project, so wrangler cannot reach the container's Dockerfile from the Worker's output directory by a relative path inside the project.

A container's image is built by wrangler deploy from the Dockerfile that @build names. The generated wrangler.toml reaches it from the Worker's output directory, <out>/workers/<worker>, by a relative path back into the project, so the output directory has to be inside the project; the path is computed from the directory the build is written to. A build into a directory outside the project is refused, naming each container and both paths, because a path that climbs out and back in would break when the output is moved, and copying the build directory into the output would take node_modules, secrets and large files with it. Build into a directory inside the project: set [build] out or pass --out a path under the project root.

Example

bynk.toml
[build]
out = "../dist" # ✗ outside the project
out = "dist" # ✓ inside it

In the Book

See also

  • Every code in its category, Other, on the diagnostic index.
  • bynk explain bynk.container.output_outside_project shows the same from the installed toolchain, without a network.