unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Alexey Abramov via Guix-patches via <guix-patches@gnu.org>
To: 51597@debbugs.gnu.org
Subject: [bug#51597] [PATCH] services: docker: Add 'environment-variables' configuration field.
Date: Thu,  4 Nov 2021 07:48:09 +0100	[thread overview]
Message-ID: <20211104064809.11582-1-levenson@mmer.org> (raw)

* 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.
---
 doc/guix.texi           | 3 +++
 gnu/services/docker.scm | 6 ++++++
 2 files changed, 9 insertions(+)

diff --git a/doc/guix.texi b/doc/guix.texi
index 8693249d7c..cf269d6014 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33303,6 +33303,9 @@ Enable or disable debug output.
 @item @code{enable-iptables?} (default @code{#t})
 Enable or disable the addition of iptables rules.
 
+@item @code{environment-variables} (default: @code{()})
+Environment variables to set for dockerd
+
 @end table
 @end deftp
 
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)))))
-- 
2.31.1





             reply	other threads:[~2021-11-04  6:49 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-04  6:48 Alexey Abramov via Guix-patches via [this message]
2021-11-17 15:19 ` bug#51597: [PATCH] services: docker: Add 'environment-variables' configuration field Ludovic Courtès

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211104064809.11582-1-levenson@mmer.org \
    --to=guix-patches@gnu.org \
    --cc=51597@debbugs.gnu.org \
    --cc=levenson@mmer.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).