Skip to content

dicer create

Records an instance definition, pulling the image first as --pull says: by default, only if the host does not hold it. Nothing is booted until you run dicer start, unless --start is given. The instance is named after the image unless NAME is given.

A command after – replaces the image’s ENTRYPOINT and CMD.

Usage

$ dicer create [NAME] [-- COMMAND [ARG...]] [flags]

Examples

$ dicer instance create web -i nginx:1.27 --network default -p 8080:80
$ dicer instance create web -i nginx:1.27 --start
$ dicer instance create worker -i alpine:3.21 -e QUEUE=jobs -- /bin/worker --verbose

Flags

FlagDescription
--disk stringOverlay disk size, e.g. 10GiB. Default: 10GiB.
--disk-iops intOperations per second each disk can be read and written at (0: unlimited).
--disk-rate stringBytes per second each disk can be read and written at, e.g. 50MiB (0: unlimited).
--download-rate stringBytes per second the guest can receive, e.g. 10MiB (0: unlimited).
-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 intFailed 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 hypervisor’s default version, which dicer info shows).
-i, --image stringContainer image reference, e.g. docker.io/library/ubuntu:24.04.
--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 (default: the default kernel).
--kernel-args stringKernel command line arguments.
-l, --label stringArrayLabel as KEY=VALUE (repeatable).
--max-memory stringMost memory dicer resize can give the running instance, e.g. 4GiB (0: none).
--max-vcpus intMost vCPUs dicer resize can give the running instance, on Cloud Hypervisor on x86_64 (0: none).
-m, --memory stringMemory, e.g. 512MiB or 2GiB. Default: 512MiB.
--mount stringArrayMount 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).
--network stringNetwork to attach to (default: the default network).
--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.
--standby-after durationPut the instance on standby once it has been idle this long, e.g. 15m (0: never).
--startStart the instance immediately after defining it.
--upload-rate stringBytes per second the guest can send, e.g. 10MiB (0: unlimited).
-u, --user stringUser the command runs as: user, uid, user:group or uid:gid (default: the image’s USER, or root).
--vcpus intNumber 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).
--request-timeout durationGive 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).