From patchwork Thu Nov 4 06:48:09 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Abramov X-Patchwork-Id: 34235 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 3D10B27BBE4; Thu, 4 Nov 2021 06:49:38 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,T_DKIM_INVALID, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 9356F27BBE3 for ; Thu, 4 Nov 2021 06:49:37 +0000 (GMT) Received: from localhost ([::1]:56438 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1miWZ6-0003QZ-KY for patchwork@mira.cbaines.net; Thu, 04 Nov 2021 02:49:36 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51314) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miWYZ-0003OJ-0r for guix-patches@gnu.org; Thu, 04 Nov 2021 02:49:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:58544) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1miWYY-0007vD-Jz for guix-patches@gnu.org; Thu, 04 Nov 2021 02:49:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1miWYY-0004LE-E5 for guix-patches@gnu.org; Thu, 04 Nov 2021 02:49:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#51597] [PATCH] services: docker: Add 'environment-variables' configuration field. Resent-From: Alexey Abramov Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 04 Nov 2021 06:49:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 51597 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 51597@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.163600851616652 (code B ref -1); Thu, 04 Nov 2021 06:49:02 +0000 Received: (at submit) by debbugs.gnu.org; 4 Nov 2021 06:48:36 +0000 Received: from localhost ([127.0.0.1]:41857 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miWY8-0004KW-1r for submit@debbugs.gnu.org; Thu, 04 Nov 2021 02:48:36 -0400 Received: from lists.gnu.org ([209.51.188.17]:57790) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1miWY6-0004KN-1A for submit@debbugs.gnu.org; Thu, 04 Nov 2021 02:48:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51230) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miWY1-0003Bu-6u for guix-patches@gnu.org; Thu, 04 Nov 2021 02:48:29 -0400 Received: from mail.mmer.org ([178.22.65.174]:57794) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1miWXz-0007Yl-8f for guix-patches@gnu.org; Thu, 04 Nov 2021 02:48:28 -0400 Received: from mail.mmer.org (localhost [127.0.0.1]) by mail.mmer.org (OpenSMTPD) with ESMTP id f1afac48 for ; Thu, 4 Nov 2021 06:48:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed; d=mmer.org; h=from:to :subject:date:message-id:mime-version:content-transfer-encoding; s=dkim; bh=IAxNBaZGlxEJXpH7bwuYE5iyCtcQeEHy/YGvUParaXU=; b=7zYk uza6aeUnLuEamAxSlLzv4xHLqbMQaD6lvK3pu6ONJDdJi3m1aXXF7ISc09Co029H Gthu/qf726teJqt+JdqZ37EVALCDCa4TRcgm/BHVAV3+xeY5ZVT7LTGfqEAiBu11 MZys1nOKaHzUJb7aQ8Rhf9mys1UYBKsT32CnpsA= Received: from delta (j74182.upc-j.chello.nl [24.132.74.182]) by mail.mmer.org (OpenSMTPD) with ESMTPSA id 28a6bdfb (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO) for ; Thu, 4 Nov 2021 06:48:20 +0000 (UTC) Date: Thu, 4 Nov 2021 07:48:09 +0100 Message-Id: <20211104064809.11582-1-levenson@mmer.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Received-SPF: pass client-ip=178.22.65.174; envelope-from=levenson@mmer.org; helo=mail.mmer.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" Reply-to: Alexey Abramov X-ACL-Warn: , Alexey Abramov via Guix-patches X-Patchwork-Original-From: Alexey Abramov via Guix-patches via From: Alexey Abramov X-getmail-retrieved-from-mailbox: Patches * 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)))))