GNU bug report logs - #68073
[PATCH] Add config-file configuration option to dockerd

Previous Next

Package: guix-patches;

Reported by: Connor Clark <connor <at> psyleft.com>

Date: Thu, 28 Dec 2023 04:14:01 UTC

Severity: normal

Tags: patch

Done: Mathieu Othacehe <othacehe <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Connor Clark <connor <at> psyleft.com>
Subject: bug#68073: closed (Re: [bug#68073] [PATCH v2] services: docker:
 Add config-file option.)
Date: Wed, 03 Jan 2024 14:32:02 +0000
[Message part 1 (text/plain, inline)]
Your bug report

#68073: [PATCH] Add config-file configuration option to dockerd

which was filed against the guix-patches package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to 68073 <at> debbugs.gnu.org.

-- 
68073: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=68073
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Mathieu Othacehe <othacehe <at> gnu.org>
To: Connor Clark <connor <at> psyleft.com>
Cc: 68073-done <at> debbugs.gnu.org
Subject: Re: [bug#68073] [PATCH v2] services: docker: Add config-file option.
Date: Wed, 03 Jan 2024 15:31:32 +0100
> * gnu/services/docker.scm (docker-configuration)[config-file] Add file-like
> field.
> * doc/guix.texi (Docker Service): Add information about config-file.

Applied, thanks,

Mathieu

[Message part 3 (message/rfc822, inline)]
From: Connor Clark <connor <at> psyleft.com>
To: guix-patches <at> gnu.org
Cc: Connor Clark <connor <at> psyleft.com>
Subject: [PATCH] Add config-file configuration option to dockerd
Date: Wed, 27 Dec 2023 15:20:21 -0500
---

This is my first time submitting a patch here, so please let me know if I'm
missing something important, or my email is formatted incorrectly, or anything
else.

This patch adds an option to pass a json configuration file directly into
dockerd for options which aren't available in the docker-configuration record,
of which there are many. From what I've seen, some other packages use a
raw-configuration-string that gets appended into a file to accomplish similar
things, but I figured a file-like was better here because the rest of the
options are passed into the command invocation and not serialized into a file.

 gnu/services/docker.scm | 12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm
index 72ef7d74db..4d32b96847 100644
--- a/gnu/services/docker.scm
+++ b/gnu/services/docker.scm
@@ -61,6 +61,8 @@ (define-module (gnu services docker)
             oci-container-service-type
             oci-container-shepherd-service))
 
+(define-maybe file-like)
+
 (define-configuration docker-configuration
   (docker
    (file-like docker)
@@ -87,6 +89,9 @@ (define-configuration docker-configuration
   (environment-variables
    (list '())
    "Environment variables to set for dockerd")
+  (config-file
+   (maybe-file-like)
+   "JSON configuration file to pass to dockerd")
   (no-serialization))
 
 (define %docker-accounts
@@ -131,7 +136,8 @@ (define (docker-shepherd-service 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)))
+         (debug? (docker-configuration-debug? config))
+         (config-file (docker-configuration-config-file config)))
     (shepherd-service
            (documentation "Docker daemon.")
            (provision '(dockerd))
@@ -144,6 +150,10 @@ (define (docker-shepherd-service config)
            (start #~(make-forkexec-constructor
                      (list (string-append #$docker "/bin/dockerd")
                            "-p" "/var/run/docker.pid"
+                           #$@(if (not (eq? config-file %unset-value))
+                                  (list #~(string-append
+                                           "--config-file=" #$config-file))
+                                  '())
                            #$@(if debug?
                                   '("--debug" "--log-level=debug")
                                   '())

base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b
-- 
2.41.0




This bug report was last modified 1 year and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.