From patchwork Sun Apr 14 23:02:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxim Cournoyer X-Patchwork-Id: 3289 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 E699016E67; Mon, 15 Apr 2019 00:12:18 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id 1893016E65 for ; Mon, 15 Apr 2019 00:12:18 +0100 (BST) Received: from localhost ([127.0.0.1]:41871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFoIJ-0007VP-3N for patchwork@mira.cbaines.net; Sun, 14 Apr 2019 19:12:15 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40858) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFoI9-0007RV-2i for guix-patches@gnu.org; Sun, 14 Apr 2019 19:12:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFoI6-0006IT-Qh for guix-patches@gnu.org; Sun, 14 Apr 2019 19:12:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47984) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFoI6-0006IK-Kk for guix-patches@gnu.org; Sun, 14 Apr 2019 19:12:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hFoI6-0008My-EG for guix-patches@gnu.org; Sun, 14 Apr 2019 19:12:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#35281] [PATCH] gnu: docker: Add a couple go dependencies and enable docker-proxy. Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 14 Apr 2019 23:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 35281 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 35281@debbugs.gnu.org X-Debbugs-Original-To: guix-patches Received: via spool by submit@debbugs.gnu.org id=B.155528351632159 (code B ref -1); Sun, 14 Apr 2019 23:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 14 Apr 2019 23:11:56 +0000 Received: from localhost ([127.0.0.1]:33295 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFoHv-0008MX-H8 for submit@debbugs.gnu.org; Sun, 14 Apr 2019 19:11:56 -0400 Received: from eggs.gnu.org ([209.51.188.92]:54529) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hFoHt-0008MJ-2N for submit@debbugs.gnu.org; Sun, 14 Apr 2019 19:11:50 -0400 Received: from lists.gnu.org ([209.51.188.17]:53293) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1hFoHm-0005Z8-GQ for submit@debbugs.gnu.org; Sun, 14 Apr 2019 19:11:42 -0400 Received: from eggs.gnu.org ([209.51.188.92]:40443) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hFoHk-0006v7-09 for guix-patches@gnu.org; Sun, 14 Apr 2019 19:11:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hFo9L-000855-O1 for guix-patches@gnu.org; Sun, 14 Apr 2019 19:03:01 -0400 Received: from mail-qt1-x832.google.com ([2607:f8b0:4864:20::832]:42840) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hFo9L-00084O-0G for guix-patches@gnu.org; Sun, 14 Apr 2019 19:02:59 -0400 Received: by mail-qt1-x832.google.com with SMTP id p20so17135523qtc.9 for ; Sun, 14 Apr 2019 16:02:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=uFeN9Nl1N7BO9beJ5SsuKaiIhNG6723feJ6tCjPi9yg=; b=EUfkKzdtuW2haSv1vtQzHZDMUW7bCMKkDCPNJldEpsMBFIUC82S7LsnlN3E0p7Vg3s C5gxQZ4ELCJvOWoKok5QocVhQadbw/3g7M3IL+8EwxTL7dryVnNsCIQkS7vZ/3jDdQ43 al+o8O/4dhsL4oU3qnd7HRVd7rGu83YLuwpMn+/KB3+c8FMJwoR1Po6wtEQvI+r459hI WPZRMQ7dZN6RVNTdrxIEfSpvW40ii3r4h0Wp3iTxlZiuDFLmIG9pEMFs/Z7g5u1AalCq OVW7ALM+0DlviAqwXnB2JaL5K0+YXqg3B/VEcJ/fT+y8LSoAfLLlzuUTx+bu8acsHHGn 6sJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=uFeN9Nl1N7BO9beJ5SsuKaiIhNG6723feJ6tCjPi9yg=; b=gnn8X0NIq9E7BwohHn56BBkqA7sn2C4M06sSSo/QqvXI6sO+/HSDrBfLAVGIV37chb fUVUjrrU2RaFKzotxoxPQy0iplsXXqf2IbducfeK1KlFmary39NV/kSJgNrofYGsujsQ VbO1EnnTB2RJFWvxBX836wGAaoB0ci1pOEqPy4azVhN55LJH8okkC0h0tlkDiBOdEg6T LDV4hdUr6MrtOhjwKRf7aKVyXCWQIsrUUP0ayBCeuEUNNzX69OfojuRCAS4P49tYqfM3 4vBUwjeWzP+x+flMmC5o39YOOFrzrVtqz1pAG2Orb3vEmlQXF91q/pIbPctVyId9tX9x rJcg== X-Gm-Message-State: APjAAAXALdLN9pmLefrEtpgz5+qyRxXrSVaf56IAQZq++IGeENHLbpDt tWduwUspD5UOAkZkz0/YDT1TZ9l1 X-Google-Smtp-Source: APXvYqy0CldgXR7yz2QwkJ/c5q1bmJa421pEjebrhF5j0SaS7RUYN3Lj+15VG7WbsIcdzFRJ5xwZAw== X-Received: by 2002:ac8:72cb:: with SMTP id o11mr53574683qtp.84.1555282978068; Sun, 14 Apr 2019 16:02:58 -0700 (PDT) Received: from kwak (dsl-10-136-224.b2b2c.ca. [72.10.136.224]) by smtp.gmail.com with ESMTPSA id r31sm28172903qtj.17.2019.04.14.16.02.56 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 14 Apr 2019 16:02:56 -0700 (PDT) From: Maxim Cournoyer Date: Sun, 14 Apr 2019 19:02:53 -0400 Message-ID: <87muksnqaq.fsf@gmail.com> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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" X-getmail-retrieved-from-mailbox: Patches Hello Guix! Before this change, attempting to start a docker registry such as with the following command[0]: --8<---------------cut here---------------start------------->8--- docker run -d -p 5000:5000 --restart=always --name registry registry:2 --8<---------------cut here---------------end--------------->8--- Would give the following error: --8<---------------cut here---------------start------------->8--- /gnu/store/dzaijl53fcd3jhkpd70vsf4cnvv10ywj-docker-cli-18.09.3/bin/docker: Error response from daemon: driver failed programming external connectivity on endpoint registry (709754084a9e208c32075e47ea9584296a6f274deeef08283d0de9c9a5161112): exec: "docker-proxy": executable file not found in $PATH. --8<---------------cut here---------------end--------------->8--- This series of patches adds docker-libnetwork-cmd-proxy and a few new go packages it required. The docker service is modified to enable (or disable) using a 'docker-proxy'. Thanks! Maxim From fd1003dc333ede95a8fa2813b7e8ab2f6cfe82d2 Mon Sep 17 00:00:00 2001 From: Maxim Cournoyer Date: Fri, 5 Apr 2019 02:34:16 -0400 Subject: [PATCH 6/6] services: docker: Add new fields to support proxy. The Docker proxy enables inter-container and outside-to-container loopback, and is required by the Docker registry server. * gnu/services/docker.scm (docker-configuration)[proxy, enable-proxy?]: Add fields. (docker-shepherd-service): Use them. (serialize-boolean): New function. --- gnu/services/docker.scm | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/gnu/services/docker.scm b/gnu/services/docker.scm index 8b5edf5cb0..94a04c8996 100644 --- a/gnu/services/docker.scm +++ b/gnu/services/docker.scm @@ -31,13 +31,25 @@ #:export (docker-configuration docker-service-type)) +;;; We're not using serialize-configuration, but we must define this because +;;; the define-configuration macro validates it exists. +(define (serialize-boolean field-name val) + "") + (define-configuration docker-configuration (docker (package docker) "Docker daemon package.") (containerd (package containerd) - "containerd package.")) + "containerd package.") + (proxy + (package docker-libnetwork-cmd-proxy) + "The proxy package to support inter-container and outside-container +loop-back communications.") + (enable-proxy? + (boolean #t) + "Enable or disable the user-land proxy (enabled by default).")) (define %docker-accounts (list (user-group (name "docker") (system? #t)))) @@ -66,7 +78,9 @@ (stop #~(make-kill-destructor))))) (define (docker-shepherd-service config) - (let* ((docker (docker-configuration-docker config))) + (let* ((docker (docker-configuration-docker config)) + (enable-proxy? (docker-configuration-enable-proxy? config)) + (proxy (docker-configuration-proxy config))) (shepherd-service (documentation "Docker daemon.") (provision '(dockerd)) @@ -83,7 +97,10 @@ udev)) (start #~(make-forkexec-constructor (list (string-append #$docker "/bin/dockerd") - "-p" "/var/run/docker.pid") + "-p" "/var/run/docker.pid" + (if #$enable-proxy? "--userland-proxy" "") + "--userland-proxy-path" (string-append #$proxy + "/bin/proxy")) #:pid-file "/var/run/docker.pid" #:log-file "/var/log/docker.log")) (stop #~(make-kill-destructor))))) -- 2.20.1