dicer create
Define an instance without starting it
Synopsis
Records an instance definition. Nothing is booted until you run ‘dicer start’, unless –start is given.
A command after – replaces the image’s ENTRYPOINT and CMD.
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 --verboseOptions
-i, --image string Container image reference, e.g. docker.io/library/ubuntu:24.04
--kernel string Kernel to boot with
--kernel-args string Kernel command line arguments
--hypervisor-type string Hypervisor: cloud-hypervisor or firecracker (default: cloud-hypervisor)
--hypervisor-version string Hypervisor version (default: the newest available)
--vcpus int32 Number of virtual CPUs (default 1)
-m, --memory string Memory, e.g. 512MiB or 2GiB (default "512MiB")
--disk string Overlay disk size, e.g. 10GiB (default "10GiB")
--network string Network to attach to
--ip string Static IP address (default: assigned from the subnet)
-p, --publish stringArray Publish a guest port on the host, as [hostIP:]hostPort:guestPort[/tcp|udp] (repeatable)
--mount stringArray Mount a volume, host file or tmpfs, as [type=volume|file|tmpfs,][source=...,]target=/path[,readonly] (repeatable)
-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)
-l, --label stringArray Label as KEY=VALUE (repeatable)
--hostname string Guest hostname (default: the instance name)
--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
--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-tcp int Check health by connecting to a TCP port in the guest
--health-interval duration Time between health checks (default 10s)
--health-timeout duration Time a health check may take (default 5s)
--health-start-period duration Time after a start in which failed checks do not count (default none)
--health-retries int32 Failed checks in a row that make the instance unhealthy (default 3)
--no-healthcheck Check no health, not even as the image says to
--init-mode string How the guest starts the command: auto, exec (as PID 1 of its own PID namespace) or systemd (default auto)
--start Start the instance immediately after defining it
-h, --help help for createOptions inherited from parent commands
-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)
--timeout duration Give 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)SEE ALSO
- dicer - Run virtual machines from container images