diff options
author | Giacomo Leidi <goodoldpaul@autistici.org> | 2024-05-04 00:11:15 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2024-05-25 15:34:47 +0200 |
commit | 68adfaea25a31247c1555f503839f928ba2e9a04 (patch) | |
tree | 182fe97336e2f9b10b50929887ac914a83d7e395 /gnu/services/docker.scm | |
parent | e68c1af4f4cb2223b37c7bdcc925ca6ad551da24 (diff) |
gnu: docker: Allow setting Shepherd dependencies in oci-container-configuration.
* gnu/services/docker.scm (oci-container-configuration)
[requirement]: New field;
(list-of-symbols): sanitize it;
(oci-container-shepherd-service): use it.
* doc/guix.texi: Document it.
Change-Id: Ic0ba336a2257d6ef7c658cfc6cd630116661f581
Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services/docker.scm')
-rw-r--r-- | gnu/services/docker.scm | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index df5884aca1..a5b1614fa9 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -320,6 +320,9 @@ found!") but ~a was found") el)))) value)) +(define list-of-symbols? + (list-of symbol?)) + (define-maybe/no-serialization string) (define-configuration/no-serialization oci-container-configuration @@ -376,6 +379,10 @@ Engine, and follow the usual format (provision (maybe-string) "Set the name of the provisioned Shepherd service.") + (requirement + (list-of-symbols '()) + "Set additional Shepherd services dependencies to the provisioned Shepherd +service.") (network (maybe-string) "Set a Docker network for the spawned container.") @@ -477,6 +484,7 @@ to the @command{docker run} invokation." (oci-container-configuration-host-environment config)) (command (oci-container-configuration-command config)) (provision (oci-container-configuration-provision config)) + (requirement (oci-container-configuration-requirement config)) (image (oci-container-configuration-image config)) (options (oci-container-configuration->options config)) (name (guess-name provision image)) @@ -484,7 +492,7 @@ to the @command{docker run} invokation." (oci-container-configuration-extra-arguments config))) (shepherd-service (provision `(,(string->symbol name))) - (requirement '(dockerd user-processes)) + (requirement `(dockerd user-processes ,@requirement)) (respawn? #f) (documentation (string-append |