From patchwork Wed Dec 27 20:20:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Connor Clark X-Patchwork-Id: 58141 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 4AD8727BBE9; Thu, 28 Dec 2023 18:48:02 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 3891427BBE2 for ; Thu, 28 Dec 2023 18:48:01 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rIvQD-0000yZ-62; Thu, 28 Dec 2023 13:47:57 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIhmb-0008RI-Ja for guix-patches@gnu.org; Wed, 27 Dec 2023 23:14:09 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rIhma-0006EG-He; Wed, 27 Dec 2023 23:14:08 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rIhmT-0006pk-TH; Wed, 27 Dec 2023 23:14:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68073] [PATCH] Add config-file configuration option to dockerd Resent-From: Connor Clark Original-Sender: "Debbugs-submit" Resent-CC: paren@disroot.org, guix@cbaines.net, ludo@gnu.org, othacehe@gnu.org, rg@raghavgururajan.name, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, jgart@dismail.de, guix-patches@gnu.org Resent-Date: Thu, 28 Dec 2023 04:14:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 68073 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68073@debbugs.gnu.org Cc: Connor Clark , paren@disroot.org, guix@cbaines.net, ludo@gnu.org, othacehe@gnu.org, rg@raghavgururajan.name, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, jgart@dismail.de X-Debbugs-Original-To: guix-patches@gnu.org X-Debbugs-Original-Xcc: paren@disroot.org, guix@cbaines.net, ludo@gnu.org, othacehe@gnu.org, rg@raghavgururajan.name, rekado@elephly.net, zimon.toutoune@gmail.com, me@tobias.gr, jgart@dismail.de Received: via spool by submit@debbugs.gnu.org id=B.170373678526169 (code B ref -1); Thu, 28 Dec 2023 04:14:01 +0000 Received: (at submit) by debbugs.gnu.org; 28 Dec 2023 04:13:05 +0000 Received: from localhost ([127.0.0.1]:38215 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIhlY-0006nx-8P for submit@debbugs.gnu.org; Wed, 27 Dec 2023 23:13:05 -0500 Received: from lists.gnu.org ([2001:470:142::17]:44648) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rIaYG-0008LT-P3 for submit@debbugs.gnu.org; Wed, 27 Dec 2023 15:30:53 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rIaYC-0000QF-1A for guix-patches@gnu.org; Wed, 27 Dec 2023 15:30:48 -0500 Received: from mout-p-202.mailbox.org ([2001:67c:2050:0:465::202]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1rIaY8-0001th-MK for guix-patches@gnu.org; Wed, 27 Dec 2023 15:30:47 -0500 Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-202.mailbox.org (Postfix) with ESMTPS id 4T0jvJ3jHdz9sSx; Wed, 27 Dec 2023 21:30:36 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=psyleft.com; s=MBO0001; t=1703709036; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=YpWfJI5+liU9cN6dWlPPhjZYLiGRoRLtbC/rn+UBKiU=; b=I5+O+4QtqKWgDusx6v3wh/C7m48uAsbIicqM6j9Y6Co0Ikmq07aWUYftOmgupPt2707yrT dt3KIpC3zpnv6+VPyno2HjPXI2K8L7ve23GazZcQrqJN1C+tdNOFO+IAEb+ZeuWvOfcbbp 1kiWeJOnCecTdW7hb1+wUpyPyPxDlDEnIcIaCsgtcDL9ZKM2s6UgRamwbKl4JI5uUgQIwS HHei7u+j3dz47N2NrhGProCW4M+A/05oPf6b5kVBgMCH7lJAcMomg6xeE/cf58XRqJaLv+ sD2FW+Y5di3DyL+KF7Zm3HuxdVMG+mdforG1ALuqjC2ubZ/OrFgBIXYlJPczFA== Date: Wed, 27 Dec 2023 15:20:21 -0500 Message-ID: <20231227203015.14265-1-connor@psyleft.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4T0jvJ3jHdz9sSx Received-SPF: pass client-ip=2001:67c:2050:0:465::202; envelope-from=connor@psyleft.com; helo=mout-p-202.mailbox.org X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Wed, 27 Dec 2023 23:13:03 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Mailman-Approved-At: Thu, 28 Dec 2023 13:47:55 -0500 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-to: Connor Clark X-ACL-Warn: , Connor Clark via Guix-patches X-Patchwork-Original-From: Connor Clark via Guix-patches via From: Connor Clark Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches --- 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(-) base-commit: 5bd80ccd69047b1777749e24d4adf2c951b5d14b 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") '())