Daemon configuration
dicerd reads its configuration from /etc/dicerd/config.yaml, or the file dicerd serve --config names, when it starts: a changed file is taken up by restarting it. The file is optional, as every key has a default, and unknown keys are rejected: check a change with sudo dicerd validate before sudo systemctl restart dicerd.
data_dir: /var/lib/dicer
server:
listen: 0.0.0.0:7443
socket:
group: dicer
metrics:
enable: true
images:
gc_max_size: 50GiBGeneral
The daemon’s own settings. The sections after them are the server, resources, networking, metrics, images, events and registries.
data_dir
string
data_dir is where the daemon keeps what persists: the definitions of instances, networks, volumes, kernels and tokens, the images, the instances’ disks, and the certificate it makes for itself. Unset is /var/lib/dicer.
run_dir
string
run_dir is where the daemon keeps runtime state: sockets, config disks and the record of what is running. It should be a tmpfs, so that a reboot clears it. Unset is /run/dicer.
log_level
string
log_level is debug, info, warn or error. Unset is info.
server
mapping
server is where the API is served: always on a Unix socket, and over TCP too if server.listen is set.
server.listen
string
listen is the host:port to serve the API on over TCP, such as 0.0.0.0:7443. Unset, the API is served on the socket alone. Over TCP, every connection uses TLS 1.3, and every call needs a token, which dicer token create makes. Guests cannot reach it, on any of the host’s addresses.
server.crt_file
string
crt_file is the PEM certificate the API is served with over TCP. It must name the address clients connect to, and is reloaded when it changes on disk. Unset, the daemon makes a certificate of its own and keeps it in data_dir. Every token then carries its fingerprint, so clients need nothing else to check the daemon by.
server.key_file
string
key_file is the PEM private key of crt_file. It is reloaded when it changes on disk.
server.socket
mapping
socket is the local Unix socket. Anyone who can open it has full control of the daemon.
server.socket.path
string
path is the socket’s path. Unset is /run/dicer/dicer.sock.
server.socket.mode
integer
mode is the socket’s permission bits. Unset is 0660.
server.socket.group
string
group is the group the socket belongs to, by name or ID. Its members can use the API as far as mode lets the group, which is as much as root on this host. Unset leaves the socket root’s alone.
server.keepalive
mapping
keepalive is how the daemon finds clients that have gone without closing their connection, because their host lost power or the network between dropped, and how often clients may check the same of it. Such a connection otherwise lasts until the kernel gives up on it, which can take a quarter of an hour.
server.keepalive.interval
duration, such as 30s or 5m
interval is how long a connection may carry nothing before the daemon pings the client. Unset is 30s.
server.keepalive.timeout
duration, such as 30s or 5m
timeout is how long the daemon waits for the answer to a ping before closing the connection. Unset is 10s.
server.keepalive.min_client_interval
duration, such as 30s or 5m
min_client_interval is how often a client may ping the daemon at most, even with no call in flight. A client pinging more often is disconnected. Dicer’s clients ping every 30s unless told otherwise. Unset is 10s.
resources
mapping
resources is how much CPU and memory instances may be given, all together: the host’s CPUs times cpu_overcommit, and its memory less reserved_memory_bytes times memory_overcommit. A start that would take more is refused.
resources.cpu_overcommit
number
cpu_overcommit is how many vCPUs instances may be given per host CPU. Unset is 4.
resources.memory_overcommit
number
memory_overcommit multiplies the memory available to instances: 1 never promises more memory than the host has. Unset is 1.
resources.reserved_memory_bytes
integer
reserved_memory_bytes is the memory, in bytes, kept back for the host and the hypervisors’ overhead. Unset is 1073741824, 1 GiB.
network
mapping
network is the host’s networking.
network.default_subnet
string
default_subnet is the subnet of the default network, which the daemon creates when it first starts and an instance joins when it names no network. It must not overlap a subnet the host is on. Changing it later does not change the network. Unset is 172.20.0.0/16.
network.uplink_interface
string
uplink_interface is the interface NAT traffic leaves by. Unset detects it from the default route.
network.upload_burst_multiplier
integer
upload_burst_multiplier is how far an instance may briefly exceed its upload rate limit, as a multiple of it. Unset is 4.
network.download_burst_multiplier
integer
download_burst_multiplier is how far an instance may briefly exceed its download rate limit, as a multiple of it. Unset is 4.
network.dns
boolean
dns answers guests’ DNS queries on each network’s gateway address, so that an instance can reach another on its network by name; other names are forwarded to the network’s nameservers. Off, guests ask those nameservers directly. Unset is true.
metrics
mapping
metrics is the Prometheus endpoint, served at /metrics without authentication. Metrics are always recorded: this decides only whether they are served.
metrics.enable
boolean
enable serves the endpoint.
metrics.listen
string
listen is the host:port the endpoint is served on. Unset is 127.0.0.1:9101.
images
mapping
images is image garbage collection, which removes only images no instance, running guest, guest on standby or snapshot uses. It is off while gc_max_unused_age and gc_max_size are both unset.
images.gc_max_unused_age
duration, such as 30s or 5m
gc_max_unused_age removes images unused for longer than this, such as 168h. Unset is no limit.
images.gc_max_size
size, such as 512MiB or 50GiB
gc_max_size removes the least recently used images while the store is larger than this, such as 50GiB. Unset is no limit.
images.gc_interval
duration, such as 30s or 5m
gc_interval is how often garbage collection runs. Unset is 1h.
events
mapping
events bounds the events log that dicer events shows.
events.max_count
integer
max_count is how many of the most recent events are kept. Unset is 10000.
events.max_age
duration, such as 30s or 5m
max_age drops events older than this, such as 720h. Unset is no limit.
mounts
mapping
mounts is what instances may mount from the host.
mounts.allowed_directories
list of strings
allowed_directories are the host directories that instances may mount with --mount type=directory, each with everything under it, such as /srv/shared. An instance can share no other host directory, so these are all of the host that the API can reach this way. A symbolic link under one is followed only as far as it. Unset, no instance can mount a host directory.
registries.*
mapping of names to mappings
registries are the credentials for private registries, by host as an image’s name gives it: docker.io, ghcr.io, or a registry’s host:port. Images from any other registry are pulled anonymously.
registries:
ghcr.io:
username: dicer-bot
password_file: /etc/dicerd/secrets/ghcr-tokenregistries.*.username
string
username is the user to log in as.
registries.*.password
string
password is the password or token to log in with, and password_file a file holding it, readable only by root. Give one or the other.
registries.*.password_file
string
See password, above.
registries.*.credential_helper
string
credential_helper names a docker-credential-<name> program on the daemon’s PATH, such as ecr-login, that gives the credentials instead of username and password: for a registry whose tokens expire.