diff options
author | Jaka Hudoklin <jakahudoklin@gmail.com> | 2016-09-10 12:55:46 +0200 |
---|---|---|
committer | Jaka Hudoklin <jakahudoklin@gmail.com> | 2016-09-13 12:51:13 +0200 |
commit | 5d9c62541a3524fd2c035b75058a0cb412b61f95 (patch) | |
tree | 584b9af1ef5ddd1be7a6358578dbf38af7b4177e | |
parent | 0a518618a2760ec1c7635f62603172194df81577 (diff) | |
download | nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar.gz nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar.bz2 nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar.lz nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar.xz nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.tar.zst nixlib-5d9c62541a3524fd2c035b75058a0cb412b61f95.zip |
docker module: updates
- logDriver option, use journald for logging by default - keep storage driver intact by default, as docker has sane defaults - do not choose storage driver in tests, docker will choose by itself - use dockerd binary as "docker daemon" command is deprecated and will be removed - add overlay2 to list of storage drivers
-rw-r--r-- | nixos/modules/virtualisation/docker.nix | 25 | ||||
-rw-r--r-- | nixos/tests/docker.nix | 3 |
2 files changed, 21 insertions, 7 deletions
diff --git a/nixos/modules/virtualisation/docker.nix b/nixos/modules/virtualisation/docker.nix index ebc2be087a5b..92fe98f3f9c2 100644 --- a/nixos/modules/virtualisation/docker.nix +++ b/nixos/modules/virtualisation/docker.nix @@ -40,13 +40,25 @@ in }; storageDriver = mkOption { - type = types.enum ["aufs" "btrfs" "devicemapper" "overlay" "zfs"]; - default = "devicemapper"; + type = types.nullOr (types.enum ["aufs" "btrfs" "devicemapper" "overlay" "overlay2" "zfs"]); + default = null; description = '' - This option determines which Docker storage driver to use. + This option determines which Docker storage driver to use. By default + it let's docker automatically choose preferred storage driver. ''; }; + + logDriver = + mkOption { + type = types.enum ["none" "json-file" "syslog" "journald" "gelf" "fluentd" "awslogs" "splunk" "etwlogs" "gcplogs"]; + default = "journald"; + description = + '' + This option determines which Docker log driver to use. + ''; + }; + extraOptions = mkOption { type = types.separatedString " "; @@ -88,7 +100,12 @@ in after = [ "network.target" ] ++ (optional cfg.socketActivation "docker.socket") ; requires = optional cfg.socketActivation "docker.socket"; serviceConfig = { - ExecStart = "${pkgs.docker}/bin/docker daemon --group=docker --storage-driver=${cfg.storageDriver} ${optionalString cfg.socketActivation "--host=fd://"} ${cfg.extraOptions}"; + ExecStart = ''${pkgs.docker}/bin/dockerd \ + --group=docker --log-driver=${cfg.logDriver} \ + ${optionalString (cfg.storageDriver != null) "--storage-driver=${cfg.storageDriver}"} \ + ${optionalString cfg.socketActivation "--host=fd://"} \ + ${cfg.extraOptions} + ''; # I'm not sure if that limits aren't too high, but it's what # goes in config bundled with docker itself LimitNOFILE = 1048576; diff --git a/nixos/tests/docker.nix b/nixos/tests/docker.nix index 06e511d6e0bd..1b57a94a05d4 100644 --- a/nixos/tests/docker.nix +++ b/nixos/tests/docker.nix @@ -11,9 +11,6 @@ import ./make-test.nix ({ pkgs, ...} : { { config, pkgs, ... }: { virtualisation.docker.enable = true; - # FIXME: The default "devicemapper" storageDriver fails in NixOS VM - # tests. - virtualisation.docker.storageDriver = "overlay"; }; }; |