Skip to content

cornus serve

Run the cornus server: the OCI registry, the build engine, and the deploy engine, all in one process.

Synopsis

sh
cornus serve [flags]

Description

cornus serve starts the unified HTTP server that hosts /v2/* (the OCI registry) and /.cornus/v1/* (build, deploy, exec, and tunnel endpoints). It listens until interrupted (Ctrl-C or SIGTERM).

Registry blobs and manifests are persisted through the storage backend selected by --storage; when unset, storage lives under the data dir. See Storage backends for the supported URL forms.

Listen address and exposure

cornus serve binds :5000 by default: every interface.

That is deliberate. Workloads dial back to the server: a containerized caretaker opens connections to it for client-local 9P mounts, client-side egress, credential delivery, and workload telemetry. The host's 127.0.0.1 is not the container's, so a loopback-only bind leaves all of that unable to connect. Keep the default whenever workloads need to reach the server.

The API is unauthenticated by default

Cornus is unauthenticated unless you configure auth, and it can build images, deploy workloads, and exec into them. Bound to every interface, those capabilities are available to anything that can route to the port. Before exposing a server beyond a network you trust, turn on authentication — the bind and the auth decision belong together.

To restrict the server to this machine, say so:

sh
cornus serve --addr 127.0.0.1:5000  # this machine only
cornus serve --addr 10.0.0.5:5000   # one specific interface

CORNUS_ADDR does the same thing. Restricting the bind is appropriate when you do not need workloads to reach the server — no client-local mounts, no client-side egress, no credential delivery, no workload telemetry. When the server binds loopback only it says so in its startup log, so the restriction is visible rather than a mystery timeout on the other end.

A server running in a container must bind every interface: a container binding its own loopback would make a published port (docker run -p, a Service) unreachable. The published container image and the Kubernetes manifests/Helm chart pass --addr :5000 explicitly; if you override the image's command, keep the flag. A containerized server that ends up on loopback anyway logs a warning at startup.

When --tls-cert and --tls-key are both set, the server speaks HTTPS. Adding --tls-client-ca turns on mutual TLS: a verified client certificate's CommonName becomes the caller identity, while presenting a client certificate stays optional. See Security and authentication.

For the full set of environment variables the server honors, see Server environment variables.

Flags

FlagEnv varDefaultDescription
--addrCORNUS_ADDR:5000HTTP listen address for /v2/* and /.cornus/v1/*. All interfaces by default, because a containerized caretaker dials back to the server — pass --addr 127.0.0.1:5000 to restrict it to this machine. See Listen address and exposure.
--rootlessCORNUS_ROOTLESSfalseRun the build engine in rootless mode (user namespaces).
--storageCORNUS_STORAGEdata dirRegistry persistence backend: a path, file://, mem://, or s3://bucket?region=&endpoint=&path_style=. See Storage backends.
--otelCORNUS_OTELfalseEnable OpenTelemetry (traces/metrics/logs) via the standard OTEL_* env. Also enabled implicitly when any OTEL_* exporter/endpoint env var is set.
--tls-certCORNUS_TLS_CERTPEM certificate file; serve HTTPS when set together with --tls-key.
--tls-keyCORNUS_TLS_KEYPEM private-key file; serve HTTPS when set together with --tls-cert.
--tls-client-caCORNUS_TLS_CLIENT_CAPEM CA bundle to verify client certificates (mTLS). A verified cert CommonName becomes the caller identity; presenting a cert stays optional.
--file-cacheCORNUS_FILE_CACHEfalseEnable the server per-file cache for immutable client-local mount reads. Requires --file-cache-dir.
--file-cache-dirCORNUS_FILE_CACHE_DIRRequired directory for file-cache data; use a dedicated volume.
--file-cache-chunk-sizeCORNUS_FILE_CACHE_CHUNK_SIZE1048576File-cache block size in bytes.
--file-cache-max-bytesCORNUS_FILE_CACHE_MAX_BYTESunlimitedSoft file-cache size cap enforced by garbage collection.

Examples

Serve on the default address (every interface), storing data under the data dir:

sh
cornus serve

Listen on a specific address and keep the registry in memory:

sh
cornus serve --addr :8080 --storage mem://

Persist the registry to S3-compatible storage:

sh
cornus serve --storage 's3://my-bucket?region=us-east-1&path_style=true'

Serve HTTPS with mutual TLS:

sh
cornus serve \
  --tls-cert server.crt \
  --tls-key server.key \
  --tls-client-ca clients-ca.pem

See also

Released under the Apache-2.0 License.