[PATCH] services: docker: Add 'environment-variables' configuration field.

  • Done
  • quality assurance status badge
Details
2 participants
  • Alexey Abramov
  • Ludovic Courtès
Owner
unassigned
Submitted by
Alexey Abramov
Severity
normal

Debbugs page

Alexey Abramov wrote 3 years ago
(address . guix-patches@gnu.org)
20211104064809.11582-1-levenson@mmer.org
* 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(+)

Toggle diff (47 lines)
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
Ludovic Courtès wrote 3 years ago
(name . Alexey Abramov)(address . levenson@mmer.org)(address . 51597-done@debbugs.gnu.org)
874k8ax10j.fsf@gnu.org
Hi,

Alexey Abramov <levenson@mmer.org> skribis:

Toggle quote (5 lines)
> * 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.

Applied with the clarifications below.

Thanks,
Ludo’.
Toggle diff (21 lines)
diff --git a/doc/guix.texi b/doc/guix.texi
index a9e1f66492..158261e373 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -33230,7 +33230,15 @@ Enable or disable debug output.
Enable or disable the addition of iptables rules.
@item @code{environment-variables} (default: @code{()})
-Environment variables to set for dockerd
+List of environment variables to set for @command{dockerd}.
+
+This must be a list of strings where each string has the form
+@samp{@var{key}=@var{value}} as in this example:
+
+@lisp
+(list "LANGUAGE=eo:ca:eu"
+ "TMPDIR=/tmp/dockerd")
+@end lisp
@end table
@end deftp
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 51597@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 51597
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help