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
Containerinstance, reserved beside__EventsFanout:capability Renderer = Containeris__Container_Renderer. A useragentmay not use it (bynk.container.class_collision).
Functions§
- build_
path_ problem - Why
@build’s value is not a directory the project can name, orNonewhen it is: relative, inside the project (no.., no absolute or drive path, no backslash) and not empty. A trailing/and.segments are tolerated, andnormalise_buildremoves them. - container_
class_ name - The name of the Durable Object class generated for the
Containerinstancecapability. - dockerfile_
path - The Dockerfile a
@builddirectory names:<dir>/Dockerfile. - dockerfile_
problem - The problem with the
Dockerfileof a@builddirectory, looked up byhas_file(project-relative path to whether it is a file), orNonewhen it is there. - forward_
problem - Why a
@forwardlist is not one, orNonewhen it is: at mostfirstparty::CONTAINER_MAX_FORWARDnames, each a plain identifier, none repeated. - is_
forwardable_ name - Whether
nameis a Worker secret@forwardmay 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/becomescontainers/renderer).- phase_
container_ builds bynk.container.build_missing: everyContainerinstance’s@builddirectory holds aDockerfileunderproject_root. A@buildthat 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
@portis not a port, orNonewhen it is (1 to 65535). - sleep_
after_ seconds @sleepAfteras whole seconds: more than zero and at most 6 hours, with no part second.Noneotherwise.