Unisrv logoUnisrv.io
CLI Manual

Rollout

Deploy and update container images with a single command.

unisrv rollout is the primary way to deploy containers to a service. It handles the full lifecycle — provisioning instances, registering targets, and cleaning up old ones.

Usage

unisrv rollout <service> <image> [flags]

Initial deploy

Roll out an image to a service for the first time. You need to specify the port since there are no existing targets to infer from:

unisrv rollout my-app nginx -p 80

Updating to a new image

Push your new image, then roll out. The port and replica count are auto-resolved from the existing targets:

docker push harbor.unisrv.io/app:latest
unisrv rollout my-app harbor.unisrv.io/app:latest

Works with any registry — Harbor, GHCR, Docker Hub, etc.

That's it. The command:

  1. Verifies the image is pullable
  2. Provisions new instance(s) matching the current replica count
  3. Registers new targets on the service
  4. Deregisters old targets
  5. Stops old instances

During the rollout both old and new instances serve traffic simultaneously, giving you zero-downtime overlap.

Scaling replicas

# Deploy with 3 replicas
unisrv rollout my-app nginx -p 80 -r 3

# Scale up an existing deployment
unisrv rollout my-app nginx -r 5

Resource configuration

unisrv rollout my-app my-image -p 8080 -c 2 -m 4G -e ENV=production

Target groups

Services can have multiple target groups. By default rollout operates on the default group:

# Roll out the API group
unisrv rollout my-app api-image -p 3000 -g api

# Roll out the frontend group separately
unisrv rollout my-app frontend-image -p 80 -g frontend

Cleanup control

By default rollout fully cleans up — old targets are deregistered and old instances are stopped. Use --leave-behind to change this:

# Keep old instances running (useful for debugging)
unisrv rollout my-app my-image --leave-behind instances

# Keep everything (add new instances alongside old ones)
unisrv rollout my-app my-image --leave-behind targets

All flags

FlagDescription
-g, --group <name>Target group (default: default)
-r, --replicas <n>Replica count (defaults to existing count)
-p, --port <port>Instance port (auto-resolved if existing targets agree)
-c, --vcpus <n>vCPUs per instance, 1–32 (default: 1)
-m, --memory <size>Memory per instance, e.g. 2G or 512M (default: 1024M)
-e, --env <KEY=VALUE>Environment variables (repeatable)
--network <id/name>Join instances to a network
--leave-behind <what>instances or targets

On this page