Skip to main content

Module containers

Module containers 

Source
Expand description

Container instances (#3477, slice C1): the validation of each option of capability Renderer = Container @build("…") @port(8080) …, and the name of the Durable Object class generated for an instance.

These are the pure rules. Whether <build>/Dockerfile exists is a question about the project’s files, which the driver answers (dockerfile_problem); the checker has no filesystem.

Constants§

CONTAINER_CLASS_PREFIX
The prefix of the class generated for a Container instance, reserved beside __EventsFanout: capability Renderer = Container is __Container_Renderer. A user agent may not use it (bynk.container.class_collision).

Functions§

build_path_problem
Why @build’s value is not a directory the project can name, or None when it is: relative, inside the project (no .., no absolute or drive path, no backslash) and not empty. A trailing / and . segments are tolerated, and normalise_build removes them.
container_class_name
The name of the Durable Object class generated for the Container instance capability.
dockerfile_path
The Dockerfile a @build directory names: <dir>/Dockerfile.
dockerfile_problem
The problem with the Dockerfile of a @build directory, looked up by has_file (project-relative path to whether it is a file), or None when it is there.
forward_problem
Why a @forward list is not one, or None when it is: at most firstparty::CONTAINER_MAX_FORWARD names, each a plain identifier, none repeated.
is_forwardable_name
Whether name is a Worker secret @forward may name: an identifier a process reads from its environment (letters, digits and _, not starting with a digit), at most 128 characters.
normalise_build
@build’s directory as a project-relative path without a trailing /, empty segments or . segments (./containers//renderer/ becomes containers/renderer).
phase_container_builds
bynk.container.build_missing: every Container instance’s @build directory holds a Dockerfile under project_root. A @build that is not a project path is already refused when the option is read (bynk.container.build_path), so it is skipped here.
port_problem
Why @port is not a port, or None when it is (1 to 65535).
sleep_after_seconds
@sleepAfter as whole seconds: more than zero and at most 6 hours, with no part second. None otherwise.