Skip to content

Archil.Image reference

Source: packages/archil/src/CreateImage.ts

Build sandbox images at run time, e.g. one per customer repository, with the same props as the deploy-time Image. Pass the result’s imageId to CreateSandbox.

const images = yield* Archil.CreateImage();
const image = yield* images.build({ image: `ghcr.io/acme/${tenant}:latest` });
const sandbox = yield* sandboxes.create({ name: tenant, image: image.imageId });

Source: packages/archil/src/Image.ts

A sandbox image. Archil pulls it from a public or private registry and sandboxes boot its current digest. Public images can also be used directly as a sandbox’s baseImage; build an Image for a private one, or to pin the digest every sandbox boots.

Props follow @alchemy.run/docker’s image source, like every Alchemy image resource. Archil has no builder, so a Dockerfile is built with your local Docker and pushed to push.repository, and Archil pulls it from there.

Archil has no API to delete an image, so destroying the resource only removes it from Alchemy’s state.

From a public image

export const Base = Archil.Image("Base", { image: "node:24-bookworm" });

From a private registry

export const Agent = Archil.Image("Agent", {
image: "ghcr.io/acme/agent:1",
registry: {
server: "ghcr.io",
username: "acme-bot",
password: Alchemy.Secret("GHCR_TOKEN"),
},
});

Build a Dockerfile and push it for Archil to pull

export const Agent = Archil.Image("Agent", {
dockerfile: "./agent/Dockerfile",
context: "./agent",
push: {
repository: "ghcr.io/acme/agent",
credentials: { server: "ghcr.io", username: "acme-bot", password: Alchemy.Secret("GHCR_TOKEN") },
},
});
const sandboxes = yield* Archil.CreateSandbox(Agent);
const sandbox = yield* sandboxes.create({ name: "task-1" });