Skip to content
This is the documentation for v0.3. Read the latest.

dicer instance run

Defines an instance from an image and boots it, pulling the image first as --pull says: by default, only if the host does not hold it. The instance is named after the image unless --name is given.

A command after the image replaces its ENTRYPOINT and CMD. Flags go before the image: everything after it is the command’s.

As with docker run, the guest’s console is written out until the instance stops, and the command exits with the status it ended with. Ctrl+C stops the instance; a second Ctrl+C stops waiting for it. With -d the instance runs in the background instead.

Usage

$ dicer instance run [flags] IMAGE [COMMAND [ARG...]]

Examples

$ dicer run --rm alpine:3.21 echo hello
$ dicer run -d --name web -p 8080:80 --memory 1GiB nginx:1.27
$ dicer run -d --vcpus 2 alpine:3.21 sleep infinity

Flags

FlagDescription
-d, --detachRun in the background: print nothing of the console and return once started.
--disk stringOverlay disk size, e.g. 10GiB. Default: 10GiB.
-e, --env stringArrayEnvironment variable as KEY=VALUE, or KEY to pass this shell’s value (repeatable).
--env-file stringArrayRead environment variables from a file of KEY=VALUE lines (repeatable).
--health-cmd stringCommand to check health with, run by /bin/sh in the guest.
--health-http stringCheck health with an HTTP GET in the guest, as PORT[/path]; 2xx or 3xx is healthy.
--health-interval durationTime between health checks (default 10s).
--health-retries int32Failed checks in a row that make the instance unhealthy (default 3).
--health-start-period durationTime after a start in which failed checks do not count (default none).
--health-tcp intCheck health by connecting to a TCP port in the guest.
--health-timeout durationTime a health check may take (default 5s).
--hostname stringGuest hostname (default: the instance name).
--hypervisor-type stringHypervisor: cloud-hypervisor or firecracker (default: cloud-hypervisor).
--hypervisor-version stringHypervisor version (default: the newest available).
--init-mode stringHow the guest starts the command: auto, exec (as PID 1 of its own PID namespace) or systemd (default auto).
--ip stringStatic IP address (default: assigned from the subnet).
--kernel stringKernel to boot with.
--kernel-args stringKernel command line arguments.
-l, --label stringArrayLabel as KEY=VALUE (repeatable).
-m, --memory stringMemory, e.g. 512MiB or 2GiB. Default: 512MiB.
--mount stringArrayMount a volume, host file or tmpfs, as [type=volume|file|tmpfs,][source=…,]target=/path[,readonly] (repeatable).
--name stringInstance name (default: the image’s name and a random suffix).
--network stringNetwork to attach to.
--no-healthcheckCheck no health, not even as the image says to.
-p, --publish stringArrayPublish a guest port on the host, as [hostIP:]hostPort:guestPort[/tcp|udp] (repeatable).
--pull stringWhen to pull the image: missing, always or never. Default: missing.
--restart stringRestart policy when the instance ends on its own: no, on-failure[:max-retries], unless-stopped or always (default no).
--rmDelete the instance once it stops, the daemon doing the deleting.
--vcpus int32Number of virtual CPUs. Default: 1.

Global flags

FlagDescription
-D, --debugTrace every call to the daemon on stderr (or set $DICER_DEBUG).
-r, --remote stringDaemon to talk to: a remote’s name, or an address (unix:///PATH or HOST:PORT) (default $DICER_REMOTE, then the current remote, then local).
--timeout durationGive up on a call to the daemon after this long, e.g. 30s (0: never; streams such as logs -f and exec are not bounded).