Skip to content

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: without linux/amd64 or with more than 2 GB of compressed layers the plan is blocked, EXPOSE and VOLUME get a warning, and if the manifest cannot be read the plan stays valid.
  • Listens on 0.0.0.0:$PORT. The platform sets the variable PORT to the port from the contract (default 8080). If the app listens only on 127.0.0.1 or 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. Alternatively health.type: "tcp" (connection only) or another health.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 ​

json
{
  "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_command replaces the image's entrypoint and command (optional).
  • env are 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_s gives 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:

RegistryTokenuser
ghcr.ioPersonal access token (classic) with read:packagesyour GitHub name
GitLabDeploy token with read_registryname of the deploy token
Docker HubPersonal access token "Read-only"your Docker Hub name
  1. Set the token as a secret, as user:token: set_secrets with { "project": "shop", "service": "web", "set": { "REGISTRY_AUTH": "acme:ghp_…" } }. The token passes through your agent; so use one that may only read and expires.
  2. Name it in the contract: "source": { "type": "image", "image": "ghcr.io/acme/shop-web:1.4.2", "pull_secret": "REGISTRY_AUTH" }.
  3. 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_FAILED comes 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.

  1. Export it as an OCI layout, for linux/amd64:

    sh
    docker 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 with gzip). Older Docker versions write another format; the upload rejects it and names the buildx command.

  2. Get an upload URL: create_upload with { "project": "shop", "kind": "image" }. The answer contains a ready curl command (example_command).

  3. 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 from EXPOSE, user, VOLUME paths. If linux/amd64 is missing, HTTP 422 comes back at once with IMAGE_PLATFORM_UNSUPPORTED and the platforms that are in the image.

  4. Plan with "source": { "type": "upload", "artifact_id": "art_…" }. The plan reports IMAGE_UPLOADED and warns with IMAGE_PORT_MISMATCH when EXPOSE does not match port, and with IMAGE_VOLUME_NOT_STORED when a VOLUME path 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:

json
{ "project": "shop", "service": "web", "set": { "DATABASE_URL": "postgres://…", "MOLLIE_API_KEY": "live_…" } }

In the contract the service names the ones it should get:

json
{ "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 ​

  1. plan_deployment with project and contract. Check changes, cost and checks in the answer. If there is a violation, the plan is blocked; the suggestion says what to do.
  2. apply_deployment with plan_id. Alternatively project + contract directly; then it is planned internally and rolled out at once when nothing blocks.
  3. Call get_deployment with wait_s: 25 repeatedly (every call waits for the next change) until healthy or failed.

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).