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)
This commit is contained in:
Benjamin Staffin 2020-02-05 16:30:31 -05:00 committed by GitHub
parent 348025bc13
commit d04bdce3d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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}";