Skip to content

Docker

virtualisation.docker.autoPrune.dates

Specification (in the format described by {manpage}systemd.time(7)) of the time at which the prune will occur.

Type: string

Default

"weekly"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.autoPrune.enable

Whether to periodically prune Docker resources. If enabled, a systemd timer will run docker system prune -f as specified by the dates option.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.autoPrune.flags

Any additional flags passed to {command}docker system prune.

Type: list of string

Default

[ ]

Example

["--all"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.daemon.settings

Configuration for docker daemon. The attributes are serialized to JSON used as daemon.conf. See https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

Type: JSON value

Default

{ }

Example

{fixed-cidr-v6 = "fd00::/80";ipv6 = true;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.enable

This option enables docker, a daemon that manages linux containers. Users in the "docker" group can interact with the daemon (e.g. to start or stop containers) using the {command}docker command line tool.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.enableNvidia

Deprecated, please use virtualisation.containers.cdi.dynamic.nvidia.enable instead.

Enable nvidia-docker wrapper, supporting NVIDIA GPUs inside docker containers.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.enableOnBoot

When enabled dockerd is started on boot. This is required for containers which are created with the --restart=always flag to work. If this option is disabled, docker might be started on demand by socket activation.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.extraOptions

The extra command-line options to pass to {command}docker daemon.

Type: strings concatenated with " "

Default

""

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.extraPackages

Extra packages to add to PATH for the docker daemon process.

Type: list of package

Default

[ ]

Example

with pkgs; [ criu ]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.listenOptions

A list of unix and tcp docker should listen to. The format follows ListenStream as described in systemd.socket(5).

Type: list of string

Default

["/run/docker.sock"]

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.liveRestore

Allow dockerd to be restarted without affecting running container. This option is incompatible with docker swarm.

Type: boolean

Default

true

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.logDriver

This option determines which Docker log driver to use.

Type: one of "none", "json-file", "syslog", "journald", "gelf", "fluentd", "awslogs", "splunk", "etwlogs", "gcplogs", "local"

Default

"journald"

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.package

The docker package to use. Type: package

Default

pkgs.docker

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix

virtualisation.docker.rootless.daemon.settings

Configuration for docker daemon. The attributes are serialized to JSON used as daemon.conf. See https://docs.docker.com/engine/reference/commandline/dockerd/#daemon-configuration-file

Type: JSON value

Default

{ }

Example

{fixed-cidr-v6 = "fd00::/80";ipv6 = true;}

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker-rootless.nix

virtualisation.docker.rootless.enable

This option enables docker in a rootless mode, a daemon that manages linux containers. To interact with the daemon, one needs to set {command}DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker-rootless.nix

virtualisation.docker.rootless.package

The docker package to use. Type: package

Default

pkgs.docker

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker-rootless.nix

virtualisation.docker.rootless.setSocketVariable

Point {command}DOCKER_HOST to rootless Docker instance for normal users by default.

Type: boolean

Default

false

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker-rootless.nix

virtualisation.docker.storageDriver

This option determines which Docker storage driver to use. By default it lets docker automatically choose the preferred storage driver. However, it is recommended to specify a storage driver explicitly, as docker's default varies over versions.

::: {.warning} Changing the storage driver will cause any existing containers and images to become inaccessible. :::

Type: null or one of "aufs", "btrfs", "devicemapper", "overlay", "overlay2", "zfs"

Default

null

Declared by: https://github.com/nixos/nixpkgs/blob/master/nixos/modules/virtualisation/docker.nix