nixos/docker: default storageDriver to "devicemapper"
Commit 9bfe92ecee ("docker: Minor improvements, fix failing test") added the services.docker.storageDriver option, made it mandatory but didn't give it a default value. This results in an ugly traceback when users enable docker, if they don't pay enough attention to also set the storageDriver option. (An attempt was made to add an assertion, but it didn't work, possibly because of how "mkMerge" works.) The arguments against a default value were that the optimal value depends on the filesystem on the host. This is, AFAICT, only in part true. (It seems some backends are filesystem agnostic.) Also, docker itself uses a default storage driver, "devicemapper", when no --storage-driver=x options are given. Hence, we use the same value as default. Add a FIXME comment that 'devicemapper' breaks NixOS VM tests (for yet unknown reasons), so we still run those with the 'overlay' driver. Closes #10100 and #10217.
This commit is contained in:
parent
424e6e501a
commit
5f17aeb403
@ -46,12 +46,10 @@ in
|
|||||||
storageDriver =
|
storageDriver =
|
||||||
mkOption {
|
mkOption {
|
||||||
type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
|
type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"];
|
||||||
|
default = "devicemapper";
|
||||||
description =
|
description =
|
||||||
''
|
''
|
||||||
This option determines which Docker storage driver to use.
|
This option determines which Docker storage driver to use.
|
||||||
It is required but lacks a default value as its most
|
|
||||||
suitable value will depend the filesystems available on the
|
|
||||||
host.
|
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
extraOptions =
|
extraOptions =
|
||||||
|
@ -11,6 +11,8 @@ import ./make-test.nix ({ pkgs, ...} : {
|
|||||||
{ config, pkgs, ... }:
|
{ config, pkgs, ... }:
|
||||||
{
|
{
|
||||||
virtualisation.docker.enable = true;
|
virtualisation.docker.enable = true;
|
||||||
|
# FIXME: The default "devicemapper" storageDriver fails in NixOS VM
|
||||||
|
# tests.
|
||||||
virtualisation.docker.storageDriver = "overlay";
|
virtualisation.docker.storageDriver = "overlay";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user