summary refs log tree commit diff
path: root/gnu/services
diff options
context:
space:
mode:
authorAlexey Abramov <levenson@mmer.org>2021-11-04 07:48:09 +0100
committerLudovic Courtès <ludo@gnu.org>2021-11-17 23:05:56 +0100
commit4ace6455063297e6de84a9a2477150a6ce9416d8 (patch)
tree7bdafcbf0def181fd7524f7b96c03aac3f54d140 /gnu/services
parent6bffa13040710fd232d6c3b9a2886a1d136a6363 (diff)
downloadguix-4ace6455063297e6de84a9a2477150a6ce9416d8.tar.gz
services: docker: Add 'environment-variables' configuration field.
* gnu/services/docker.scm (docker-configuration):  Add the field
(docker-shepherd-service): Pass the list of defined variables to
make-forkexec-constructor.
* doc/guix.texi (Miscellaneous Services): Update doc.

Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'gnu/services')
-rw-r--r--gnu/services/docker.scm6
1 files changed, 6 insertions, 0 deletions
diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
index ef551480aa..c4d48676b5 100644
--- a/gnu/services/docker.scm
+++ b/gnu/services/docker.scm
@@ -62,6 +62,9 @@ loop-back communications.")
   (enable-iptables?
    (boolean #t)
    "Enable addition of iptables rules (enabled by default).")
+  (environment-variables
+   (list '())
+   "Environment variables to set for dockerd")
   (no-serialization))
 
 (define %docker-accounts
@@ -102,6 +105,7 @@ loop-back communications.")
   (let* ((docker (docker-configuration-docker config))
          (enable-proxy? (docker-configuration-enable-proxy? config))
          (enable-iptables? (docker-configuration-enable-iptables? config))
+         (environment-variables (docker-configuration-environment-variables config))
          (proxy (docker-configuration-proxy config))
          (debug? (docker-configuration-debug? config)))
     (shepherd-service
@@ -132,6 +136,8 @@ loop-back communications.")
                            (if #$enable-iptables?
                                "--iptables"
                                "--iptables=false"))
+                     #:environment-variables
+                     (list #$@environment-variables)
                      #:pid-file "/var/run/docker.pid"
                      #:log-file "/var/log/docker.log"))
            (stop #~(make-kill-destructor)))))