mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-07-13 21:50:33 +03: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
1 changed files with 10 additions and 1 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue