mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 21:38:07 -05:00
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>
This commit is contained in:
parent
e68c1af4f4
commit
68adfaea25
2 changed files with 13 additions and 1 deletions
|
@ -40618,6 +40618,10 @@ Docker Engine, and follow the usual format
|
|||
@item @code{provision} (default: @code{""}) (type: string)
|
||||
Set the name of the provisioned Shepherd service.
|
||||
|
||||
@item @code{requirement} (default: @code{'()}) (type: list-of-symbols)
|
||||
Set additional Shepherd services dependencies to the provisioned
|
||||
Shepherd service.
|
||||
|
||||
@item @code{network} (default: @code{""}) (type: string)
|
||||
Set a Docker network for the spawned container.
|
||||
|
||||
|
|
|
@ -320,6 +320,9 @@ (define (valid? member)
|
|||
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 @@ (define-configuration/no-serialization oci-container-configuration
|
|||
(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 @@ (define (guess-name name image)
|
|||
(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 @@ (define (guess-name name image)
|
|||
(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
|
||||
|
|
Loading…
Reference in a new issue