@basetenlabs/sandbox - v0.3.0
    Preparing search index...

    Class ImageBuilder

    Describes an image as a Dockerfile and the files it copies in, to push with ImageClient.push. Start one with ImageBuilder.fromRegistry.

    A builder never changes: each method returns a new builder with the instruction appended, so one builder can safely be the base of several.

    The Dockerfile it pushes ends by copying in the sandbox API binary and making it the entrypoint, unless the builder already did either, since a sandbox needs it running to be reached. dockerfile shows the Dockerfile exactly as pushed.

    Index
    • Adds a local directory to the build context and appends COPY ["<name>", "<destination>"], where name is its name in the context. As with any COPY of a directory, its contents are copied into the destination, not the directory itself. It is read when pushed, with files keeping their permissions, a link to a file within the directory stored as a copy of the file, a link to a file outside it failing the push, and a link to a directory stored as an empty directory. Everything in it is added: no .dockerignore or default ignore rules apply.

      Needs a runtime with Node's filesystem API.

      Parameters

      Returns ImageBuilder

    • Appends ENV <name>="<value>" for each variable, with " and \ in the value escaped. $ is left as is, so the build expands variables in it, as in { PATH: "/opt/bin:$PATH" }.

      Parameters

      • variables: Record<string, string>

      Returns ImageBuilder