forked from mirrors/nixpkgs
Merge pull request #188795 from Sohalt/oci-containers-wait-for-network
nixos/oci-containers: wait for network before starting container
This commit is contained in:
commit
cd5c34bb18
|
@ -230,7 +230,10 @@ let
|
||||||
escapedName = escapeShellArg name;
|
escapedName = escapeShellArg name;
|
||||||
in {
|
in {
|
||||||
wantedBy = [] ++ optional (container.autoStart) "multi-user.target";
|
wantedBy = [] ++ optional (container.autoStart) "multi-user.target";
|
||||||
after = lib.optionals (cfg.backend == "docker") [ "docker.service" "docker.socket" ] ++ dependsOn;
|
after = lib.optionals (cfg.backend == "docker") [ "docker.service" "docker.socket" ]
|
||||||
|
# if imageFile is not set, the service needs the network to download the image from the registry
|
||||||
|
++ lib.optionals (container.imageFile == null) [ "network-online.target" ]
|
||||||
|
++ dependsOn;
|
||||||
requires = dependsOn;
|
requires = dependsOn;
|
||||||
environment = proxy_env;
|
environment = proxy_env;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue