diff options
author | Benjamin Staffin <benley@gmail.com> | 2020-02-05 16:30:31 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-05 16:30:31 -0500 |
commit | d04bdce3d1690f41667125995efcf310d936b3bf (patch) | |
tree | 0ab0ba6dc7d9b8cadeedda4b2b76d4d8d8d51c68 /nixos/modules/virtualisation | |
parent | 348025bc138c6131727cfdbd8c63c69527f713ac (diff) |
docker-containers: Don't unconditionally prune images (#79253)
NixOS has `virtualisation.docker.autoPrune.enable` for this functionality; we should not do it every time a container starts up. (also, some trivial documentation fixes)
Diffstat (limited to 'nixos/modules/virtualisation')
-rw-r--r-- | nixos/modules/virtualisation/docker-containers.nix | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/nixos/modules/virtualisation/docker-containers.nix b/nixos/modules/virtualisation/docker-containers.nix index 3a2eb97d1bf1b..216ba2c733fcd 100644 --- a/nixos/modules/virtualisation/docker-containers.nix +++ b/nixos/modules/virtualisation/docker-containers.nix @@ -39,7 +39,7 @@ let entrypoint = mkOption { type = with types; nullOr str; - description = "Overwrite the default entrypoint of the image."; + description = "Override the default entrypoint of the image."; default = null; example = "/bin/my-app"; }; @@ -145,7 +145,7 @@ let Note that this is a list of <literal>"src:dst"</literal> strings to allow for <literal>src</literal> to refer to - <literal>/nix/store</literal> paths, which would difficult with an + <literal>/nix/store</literal> paths, which would be difficult with an attribute set. There are also a variety of mount options available as a third field; please refer to the <link xlink:href="https://docs.docker.com/engine/reference/run/#volume-shared-filesystems"> @@ -220,10 +220,9 @@ let ++ map escapeShellArg container.cmd ); - ExecStartPre = ["-${pkgs.docker}/bin/docker rm -f ${name}" - "-${pkgs.docker}/bin/docker image prune -f"] ++ - (optional (container.imageFile != null) - ["${pkgs.docker}/bin/docker load -i ${container.imageFile}"]); + ExecStartPre = + ["-${pkgs.docker}/bin/docker rm -f ${name}"] ++ + (optional (container.imageFile != null) "${pkgs.docker}/bin/docker load -i ${container.imageFile}"); ExecStop = ''${pkgs.bash}/bin/sh -c "[ $SERVICE_RESULT = success ] || ${pkgs.docker}/bin/docker stop ${name}"''; ExecStopPost = "-${pkgs.docker}/bin/docker rm -f ${name}"; |