mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-09-11 15:08:33 +01:00
nixos/oci-containers: add preRunExtraOptions (#315356)
`podman --help` and `docker --help` each have global options, that must be specified before `run`.
This commit is contained in:
parent
1d6a7e4e59
commit
b2b3f5d68d
|
@ -221,6 +221,13 @@ let
|
|||
example = "hello-world";
|
||||
};
|
||||
|
||||
preRunExtraOptions = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [];
|
||||
description = "Extra options for {command}`${defaultBackend}` that go before the `run` argument.";
|
||||
example = [ "--runtime" "runsc" ];
|
||||
};
|
||||
|
||||
extraOptions = mkOption {
|
||||
type = with types; listOf str;
|
||||
default = [];
|
||||
|
@ -284,7 +291,9 @@ let
|
|||
else throw "Unhandled backend: ${cfg.backend}";
|
||||
|
||||
script = concatStringsSep " \\\n " ([
|
||||
"exec ${cfg.backend} run"
|
||||
"exec ${cfg.backend} "
|
||||
] ++ map escapeShellArg container.preRunExtraOptions ++ [
|
||||
"run"
|
||||
"--rm"
|
||||
"--name=${escapedName}"
|
||||
"--log-driver=${container.log-driver}"
|
||||
|
|
Loading…
Reference in a new issue