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 --name api -p 80 nginx:1.27
$ dicer run -d --vcpus 2 alpine:3.21 sleep infinity
Flags
| Flag | Description |
|---|---|
-d, --detach | Run in the background: print nothing of the console and return once started. |
--disk string | Overlay disk size, e.g. 10GiB. Default: 10GiB. |
--disk-iops int | Operations per second each disk can be read and written at (0: unlimited). |
--disk-rate string | Bytes per second each disk can be read and written at, e.g. 50MiB (0: unlimited). |
--download-rate string | Bytes per second the guest can receive, e.g. 10MiB (0: unlimited). |
-e, --env stringArray | Environment variable as KEY=VALUE, or KEY to pass this shell’s value (repeatable). |
--env-file stringArray | Read environment variables from a file of KEY=VALUE lines (repeatable). |
--health-cmd string | Command to check health with, run by /bin/sh in the guest. |
--health-http string | Check health with an HTTP GET in the guest, as PORT[/path]; 2xx or 3xx is healthy. |
--health-interval duration | Time between health checks (default 10s). |
--health-retries int | Failed checks in a row that make the instance unhealthy (default 3). |
--health-start-period duration | Time after a start in which failed checks do not count (default none). |
--health-tcp int | Check health by connecting to a TCP port in the guest. |
--health-timeout duration | Time a health check may take (default 5s). |
--hostname string | Guest hostname (default: the instance name). |
--hypervisor-type string | Hypervisor: cloud-hypervisor or firecracker (default: cloud-hypervisor). |
--hypervisor-version string | Hypervisor version (default: the hypervisor’s default version, which dicer info shows). |
--init-mode string | How the guest starts the command: auto, exec (as PID 1 of its own PID namespace) or systemd (default auto). |
--ip string | Static IP address (default: assigned from the subnet). |
--kernel string | Kernel to boot with (default: the default kernel). |
--kernel-args string | Kernel command line arguments. |
-l, --label stringArray | Label as KEY=VALUE (repeatable). |
--max-memory string | Most memory dicer resize can give the running instance, e.g. 4GiB (0: none). |
--max-vcpus int | Most vCPUs dicer resize can give the running instance, on Cloud Hypervisor on x86_64 (0: none). |
-m, --memory string | Memory, e.g. 512MiB or 2GiB. Default: 512MiB. |
--mount stringArray | Mount a volume, a file on this machine, a directory on the daemon’s host or a tmpfs, as [type=volume|file|directory|tmpfs,][source=…,]target=/path[,readonly] (repeatable). |
--name string | Instance name (default: the image’s name and a random suffix). |
--network string | Network to attach to (default: the default network). |
--no-healthcheck | Check no health, not even as the image says to. |
-p, --publish stringArray | Publish a guest port on the host, as [[hostIP:]hostPort:]guestPort[/tcp|udp]; without a host port, or with 0, the daemon picks a free one (repeatable). |
--pull string | When to pull the image: missing, always or never. Default: missing. |
--restart string | Restart policy when the instance ends on its own: no, on-failure[:max-retries], unless-stopped or always (default no). |
--rm | Delete the instance once it stops, the daemon doing the deleting. |
--standby-after duration | Put the instance on standby once it has been idle this long, e.g. 15m (0: never). |
--upload-rate string | Bytes per second the guest can send, e.g. 10MiB (0: unlimited). |
-u, --user string | User the command runs as: user, uid, user:group or uid:gid (default: the image’s USER, or root). |
--vcpus int | Number of virtual CPUs. Default: 1. |
Global flags
| Flag | Description |
|---|---|
-D, --debug | Trace every call to the daemon on stderr (or set $DICER_DEBUG). |
-r, --remote string | Daemon to talk to: a remote’s name, or an address (unix:///PATH or HOST:PORT) (default $DICER_REMOTE, then the current remote, then local). |
--request-timeout duration | Give up on a single call to the daemon after this long, e.g. 30s (0: never; streams such as logs -f and exec are not bounded). |