Deploy a finished image
As of: November 16, 2026
The simplest way: you have a container image in a public registry (Docker Hub, GitHub Container Registry, public.ecr.aws, Quay, …) and let your agent deploy it.
Requirements for the image
- Publicly readable, with credentials or uploaded. The platform pulls public images anonymously, private ones with a token, or your agent uploads the image directly.
linux/amd64. The servers are x86-64. ARM-only images (e.g. built on an Apple Silicon Mac without--platform linux/amd64) do not start. When planning, the platform checks a registry image at the pinned digest: withoutlinux/amd64or with more than 2 GB of compressed layers the plan is blocked,EXPOSEandVOLUMEget a warning, and if the manifest cannot be read the plan stays valid.- Listens on
0.0.0.0:$PORT. The platform sets the variablePORTto the port from the contract (default 8080). If the app listens only on127.0.0.1or on another port, the health check fails. - Answers the health check. The default is an HTTP GET on
/, a status 2xx or 3xx within 2 s is expected. Alternativelyhealth.type: "tcp"(connection only) or anotherhealth.path. - Gets by with the memory limit. If the app exceeds its limit, it is ended (
OOM_KILLED). - Stores nothing important locally, except on a volume. The rest of the file system is ephemeral (Data and storage).
Best give the image with a tag or digest. When planning it is pinned to a digest, so exactly this image runs, even if the tag later points to something else. If the service should follow new images under the tag by itself, switch on auto-deploy.
Docker Hub
Docker Hub strongly limits anonymous pulls. If a registry reports "too many requests" (HTTP 429) or a temporary error, the runner pulls the image again after 2, 5 and 15 seconds; the instance shows "registry busy" meanwhile. If the pull still fails with IMAGE_PULL_FAILED after that, use a mirror like public.ecr.aws/docker/library/<image> or the GitHub Container Registry. public.ecr.aws also throttles anonymous pulls when many services pull the same image at once.
Example contract
{
"api_version": "v1alpha1",
"services": [{
"name": "web",
"source": { "type": "image", "image": "ghcr.io/acme/shop-web:1.4.2" },
"port": 3000,
"resources": { "memory_mb": 512, "cpu": "shared-0.5" },
"health": { "path": "/healthz", "grace_period_s": 90 },
"env": { "NODE_ENV": "production", "API_URL": "https://api-shop.apps.helfinity.cloud" },
"start_command": ["node", "server.js"]
}]
}start_commandreplaces the image's entrypoint and command (optional).envare normal environment variables. Do not put passwords in them: they are in plain text in the plan and the revision. That is what secrets are for (below).grace_period_sgives a slowly starting app more time before the health check counts.
Image from a private registry
If the image is in a private registry (GitHub Container Registry, GitLab, Docker Hub, your own), the platform needs a token that may only read:
| Registry | Token | user |
|---|---|---|
ghcr.io | Personal access token (classic) with read:packages | your GitHub name |
| GitLab | Deploy token with read_registry | name of the deploy token |
| Docker Hub | Personal access token "Read-only" | your Docker Hub name |
- Set the token as a secret, as
user:token:set_secretswith{ "project": "shop", "service": "web", "set": { "REGISTRY_AUTH": "acme:ghp_…" } }. The token passes through your agent; so use one that may only read and expires. - Name it in the contract:
"source": { "type": "image", "image": "ghcr.io/acme/shop-web:1.4.2", "pull_secret": "REGISTRY_AUTH" }. - Plan. The platform already asks the registry with the token when planning. If it refuses or the image does not exist for this token,
REGISTRY_AUTH_FAILEDcomes back.
The token is an ordinary secret: stored encrypted (AES-256-GCM), not readable again, not in the app's environment, redacted from logs. The servers get it only for the pull, and it goes only to the image's registry. A new token applies from the next plan_deployment.
Own image without a registry
If your image exists only locally or in a private registry, your agent uploads it directly. Nothing is built; the platform takes the image as it is.
Export it as an OCI layout, for
linux/amd64:shdocker buildx build --platform linux/amd64 --output type=oci,dest=image.tar .An already built image works with
docker save -o image.tar <image>from Docker 25 (also withgzip). Older Docker versions write another format; the upload rejects it and names the buildx command.Get an upload URL:
create_uploadwith{ "project": "shop", "kind": "image" }. The answer contains a readycurlcommand (example_command).Upload:
curl -sS -X PUT --data-binary @image.tar -H 'Content-Type: application/x-tar' '<upload_url>'. The answer names the digest and what is in the image: ports fromEXPOSE, user,VOLUMEpaths. Iflinux/amd64is missing, HTTP422comes back at once withIMAGE_PLATFORM_UNSUPPORTEDand the platforms that are in the image.Plan with
"source": { "type": "upload", "artifact_id": "art_…" }. The plan reportsIMAGE_UPLOADEDand warns withIMAGE_PORT_MISMATCHwhenEXPOSEdoes not matchport, and withIMAGE_VOLUME_NOT_STOREDwhen aVOLUMEpath has no volume.
Limits: at most 2 GB, 20 image uploads per account in 24 hours, the URL is valid for 1 hour for one PUT. Uploaded images stay stored as long as a revision needs them. All values on Limits and compatibility.
Secrets
The agent sets passwords, DATABASE_URL and API keys beforehand with set_secrets:
{ "project": "shop", "service": "web", "set": { "DATABASE_URL": "postgres://…", "MOLLIE_API_KEY": "live_…" } }In the contract the service names the ones it should get:
{ "name": "web", "source": { "type": "image", "image": "ghcr.io/acme/shop-web:1.4.2" }, "secrets": ["DATABASE_URL", "MOLLIE_API_KEY"] }The app reads them as completely normal environment variables. Afterwards the values can no longer be read over MCP. If a secret changes, that takes effect only with the next deployment. More under Data and storage.
Flow
plan_deploymentwithprojectandcontract. Checkchanges,costandchecksin the answer. If there is aviolation, the plan is blocked; thesuggestionsays what to do.apply_deploymentwithplan_id. Alternativelyproject+contractdirectly; then it is planned internally and rolled out at once when nothing blocks.- Call
get_deploymentwithwait_s: 25repeatedly (every call waits for the next change) untilhealthyorfailed.
If nothing changes against the running state, the plan is noop and nothing is restarted.
Several services
A contract describes 1 to 10 services. Services that do not appear in the contract stay unchanged. So you can deploy one service after the other. Overall the trust level limits how many services your account may have (level 1: 3).
Every service with a port gets its own public URL, except with public: false. Services reach each other through connects_to as <service>.<project>.internal (Network).