diff options
Diffstat (limited to 'tw/services/docker.scm')
-rw-r--r-- | tw/services/docker.scm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/tw/services/docker.scm b/tw/services/docker.scm index 8361991f..46c7a933 100644 --- a/tw/services/docker.scm +++ b/tw/services/docker.scm @@ -61,7 +61,9 @@ following run.") (docker-args (list-of-strings '()) "Extra command-line arguments to pass to @code{docker run}.") (docker-cli (package docker-cli) "The package containing the Docker -executable to use.")) +executable to use.") + (extra-requirements (list-of-symbols '()) "Any Shepherd services on the host +system that this container relies on.")) (define (docker-container-shepherd-service config) (match-record config <docker-container-configuration> @@ -75,7 +77,8 @@ executable to use.")) read-only-root? remove-after-stop? docker-args - docker-cli) + docker-cli + extra-requirements) (let ((docker-run-args `(,@(if read-only-root? '("--read-only") '()) @@ -100,7 +103,8 @@ executable to use.")) (shepherd-service (provision (list (string->symbol (string-append "docker-container-" (maybe-value name image))))) - (requirement `(dockerd ,@(if (string=? network-type "none") '() '(networking)))) + (requirement `(dockerd ,@(if (string=? network-type "none") '() '(networking)) + ,@extra-requirements)) (documentation (format #f "Run a Docker container called ~s from the image ~s." (maybe-value name) image)) (start #~(lambda () |