1.0 defines how official Dispersed recipes and mirrors start, accept connections, and store files. You can also adopt it for a custom job. To pick a base and build your first image, see Docker images.
The standard at a glance
Part 1: How standard recipes work
Why the standard exists
Your job runs on an independent node operator’s hardware. Running the app, SSH server, and web proxy without administrator privileges limits what a compromised process can change. A fixed user, file layout, and package snapshot also let you move workloads between recipes without changing paths or guessing which system packages a rebuild will install. Every process runs asdispersed with UID and GID 10000. The final Dockerfile user must be USER dispersed, without a group or numeric ID. Images remove sudo and strip setuid and setgid bits at build time. You can install user-level tools in your home directory; system packages and updates to /opt/<app> require a new image.
Connect to a running job
Use the host and mapped port from your Job Run Detail page. Container ports22 and 8888 describe the services inside the image; the external port can differ.
- SSH and file transfer
- HTTPS and API clients
When launching a recipe in the Console, select your key under SSH Public Key. For an API launch, set the Docker job parameter
sshkey. Dispersed passes it to the container as SSH_PUBKEY. Allow your client’s IP address in allowed_ips. Without a key, the entrypoint skips sshd. Only dispersed can log in; root login, passwords, and keyboard-interactive authentication are disabled. You can also transfer files with SFTP or SCP.The container generates an Ed25519 host key on first start and reuses it when the same container restarts.SSH sessions inherit the five XDG directory variables, PATH, LD_LIBRARY_PATH, and variables matching NVIDIA_*, CUDA_*, or HF_* from the workload environment. The filter excludes SSH_PUBKEY, CONTAINER_ACCESS_TOKEN, and names containing TOKEN, SECRET, PASSWORD, or KEY, even when a prefix matches.input_schema array:
CONTAINER_ACCESS_TOKEN in the job’s environment variables, include 8888 in ports, and allow your client’s public IP range in allowed_ips.
A valid token is 16 to 72 ASCII characters matching [A-Za-z0-9_-]{16,72}. By default, Caddy refuses to start if the token is empty or malformed.
By default, Caddy generates a self-signed TLS certificate. To use your own, provide both CADDY_TLS_CERT and CADDY_TLS_KEY.
Filesystem and XDG directories
Writes to the container filesystem under
/home/dispersed are ephemeral. They do not persist across separate runs. Copy outputs you need out of the container before the run ends.Startup and shutdown
tini runs as PID 1, forwards shutdown signals, and reaps child processes. It starts /usr/local/bin/dispersed-entrypoint.sh, which:
- Exports the XDG variables and creates their directories.
- Clears the runtime directory, using the home-directory fallback if needed.
- Starts
sshdin the background when you supplySSH_PUBKEY. - Executes the image’s
CMD. When testing locally withdocker run, you can override this command after the image name.
Environment variables
Supported operating systems
Use Debianbookworm or trixie, or Ubuntu 22.04 or 24.04, with apt and bash. The username dispersed and UID/GID 10000 must be available or already identify the same account. Alpine, distroless, and scratch images do not support this standard.
Official images
Supported public base images
Supported public base images
dispersednetwork/base provides Ubuntu 24.04 and key-only SSH for CLI workloads. dispersednetwork/basic-auth extends it with Caddy for web workloads. These are the two officially supported public bases for building your own recipe.Public catalog recipes
Public catalog recipes
Official mirrors
Official mirrors
Mirrors include
dispersednetwork/ubuntu:24.04, dispersednetwork/debian:trixie, dispersednetwork/pytorch-pytorch, dispersednetwork/nvidia-cuda, dispersednetwork/nvidia-pytorch, and dispersednetwork/chromadb-chroma.Mirrors retain upstream files, environment variables, labels, and exposed-port metadata. Their provenance labels identify the upstream base and digest. Mirrors replace the upstream entrypoint and idle under SSH when you supply a key. To start the upstream app automatically on Dispersed, build a child image with the app’s startup command as its CMD. For an interactive job, start the app from your SSH session.Upgrading from previous recipes
A running job keeps its image until it stops. Check scripts and paths before your next run on Standard1.0.
Known limits
- If the non-root SSH server cannot bind port
22, as can happen with host networking, the app continues without SSH. Starting the container with--user 0also disables SSH. - You cannot install system packages in an SSH session or let an app update its own files in
/opt. Write to your home,/tmp, orXDG_RUNTIME_DIR. - New package layers can reintroduce setuid or setgid files. Strip these bits again in each installation layer.
Part 2: Build your own image
Start with Docker and one of the two public bases:dispersednetwork/base for CLI jobs or dispersednetwork/basic-auth for HTTP workloads. Both provide the runtime user, directories, SSH setup, and entrypoint.
Choose a tag
Dispersed records the resolved digest when you create a job. Nodes can still pull by tag, so a retry can use a different image if the tag moves. Choose an immutable content-hash tag when every run must use the same image.
Example 1: Serve a static site
Placeindex.html beside your Dockerfile. Caddy serves the file on port 8888 using the base image’s authentication and health check.
Dockerfile
Example 2: Run a web app behind Caddy
In a new directory, save the following three files. The sample Node.js API listens only on127.0.0.1:3000. Caddy is the only public web listener.
server.js
start.sh
Dockerfile
The digest pins the base image. Apt installs Node.js and its dependencies from that image’s recorded Ubuntu snapshot. It verifies the archive signature but allows historical metadata past its expiry date.
Rules for child images
- Keep
USER dispersed,WORKDIR /home/dispersed, and the inheritedENTRYPOINT. To change the launch command, setCMD. - Install code as
root:rootunder/opt/<app>without write permission for the runtime user. Write app data, configuration, caches, and state to the corresponding XDG directories. - Install extra system packages as root during the build. In the same
RUN, strip setuid and setgid bits, as in Example 2. Switch back toUSER dispersed. - Bind your app to loopback. Do not expose its internal port. Remove
CONTAINER_ACCESS_TOKENfrom the app environment and supervise the app and Caddy together. - Keep or add
LABEL com.dispersed.recipe-standard="1.0"for a conforming image. Put new labels last so label edits preserve the package-layer cache.
Test locally
From either web example’s directory, use Docker withlinux/amd64 support, OpenSSL, curl, and an SSH key pair. Adjust the key path if needed. Run these commands in the same terminal:
401. Both authenticated requests should return your site or JSON. Here -k accepts the local container’s self-signed certificate.
dispersed. Stopping this test container removes its writable filesystem because it started with --rm.