From patchwork Sun Dec 30 23:39:00 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Danny Milosavljevic X-Patchwork-Id: 613 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 1B5CE169DD; Sun, 30 Dec 2018 23:40:10 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mira.cbaines.net (Postfix) with ESMTP id 42E9C169DC for ; Sun, 30 Dec 2018 23:40:09 +0000 (GMT) Received: from localhost ([127.0.0.1]:47175 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdkgi-0003XS-HM for patchwork@mira.cbaines.net; Sun, 30 Dec 2018 18:40:08 -0500 Received: from eggs.gnu.org ([208.118.235.92]:38217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gdkgf-0003Wv-Qo for guix-patches@gnu.org; Sun, 30 Dec 2018 18:40:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gdkgc-0003so-Rx for guix-patches@gnu.org; Sun, 30 Dec 2018 18:40:05 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:42711) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gdkgc-0003sk-Oj for guix-patches@gnu.org; Sun, 30 Dec 2018 18:40:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gdkgc-0003MB-LJ for guix-patches@gnu.org; Sun, 30 Dec 2018 18:40:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#33893] [PATCH v5 1/4] gnu: Add containerd. Resent-From: Danny Milosavljevic Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 30 Dec 2018 23:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 33893 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 33893@debbugs.gnu.org Received: via spool by 33893-submit@debbugs.gnu.org id=B33893.154621315312800 (code B ref 33893); Sun, 30 Dec 2018 23:40:02 +0000 Received: (at 33893) by debbugs.gnu.org; 30 Dec 2018 23:39:13 +0000 Received: from localhost ([127.0.0.1]:42702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdkfp-0003KN-Hx for submit@debbugs.gnu.org; Sun, 30 Dec 2018 18:39:13 -0500 Received: from dd26836.kasserver.com ([85.13.145.193]:53256) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gdkfl-0003Jp-Fi for 33893@debbugs.gnu.org; Sun, 30 Dec 2018 18:39:10 -0500 Received: from dayas.3.home (77.116.200.150.wireless.dyn.drei.com [77.116.200.150]) by dd26836.kasserver.com (Postfix) with ESMTPSA id 8019533601DE; Mon, 31 Dec 2018 00:39:08 +0100 (CET) From: Danny Milosavljevic Date: Mon, 31 Dec 2018 00:39:00 +0100 Message-Id: <20181230233903.23426-2-dannym@scratchpost.org> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20181230233903.23426-1-dannym@scratchpost.org> References: <20181230121754.775-1-dannym@scratchpost.org> <20181230233903.23426-1-dannym@scratchpost.org> MIME-Version: 1.0 Tags: patch 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: 208.118.235.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 * gnu/packages/docker.scm (containerd): New variable. --- gnu/packages/docker.scm | 68 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 68 insertions(+) diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index c58f3f3ca..877800042 100644 --- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -23,9 +23,13 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system go) #:use-module (guix build-system python) #:use-module (guix utils) #:use-module (gnu packages check) + #:use-module (gnu packages golang) + #:use-module (gnu packages linux) + #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-web)) @@ -142,3 +146,67 @@ created and all the services are started as specified in the configuration.") store API. It allows programmers to interact with a Docker registry using Python without keeping their credentials in a Docker configuration file.") (license license:asl2.0))) + +(define-public containerd + (package + (name "containerd") + (version "1.2.1") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/containerd/containerd.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "16zn6p1ky3yrgn53z8h9wza53ch91fj47wj5xgz6w4c57j30f66p")))) + (build-system go-build-system) + (arguments + `(#:import-path "github.com/containerd/containerd" + #:tests? #f + #:phases + (modify-phases %standard-phases + (add-before 'build 'chdir + (lambda _ + (chdir "src/github.com/containerd/containerd") + #t)) + (add-after 'chdir 'patch-paths + (lambda* (#:key inputs outputs #:allow-other-keys) + ;; TODO: Patch "socat", "unpigz". + (substitute* "./runtime/v1/linux/runtime.go" + (("defaultRuntime[ \t]*=.*") + (string-append "defaultRuntime = \"" + (assoc-ref inputs "runc") + "/sbin/runc\"\n")) + (("defaultShim[ \t]*=.*") + (string-append "defaultShim = \"" + (assoc-ref outputs "out") + "/bin/containerd-shim\"\n"))) + (substitute* "./vendor/github.com/containerd/go-runc/runc.go" + (("DefaultCommand[ \t]*=.*") + (string-append "DefaultCommand = \"" + (assoc-ref inputs "runc") + "/sbin/runc\"\n"))) + #t)) + (replace 'build + (lambda* (#:key (make-flags '()) #:allow-other-keys) + (apply invoke "make" make-flags))) + (replace 'install + (lambda* (#:key outputs (make-flags '()) #:allow-other-keys) + (let* ((out (assoc-ref outputs "out"))) + (apply invoke "make" (string-append "DESTDIR=" out) "install" + make-flags))))))) + (inputs + `(("btrfs-progs" ,btrfs-progs) + ("libseccomp" ,libseccomp) + ("runc" ,runc))) + (native-inputs + `(("go" ,go) + ("pkg-config" ,pkg-config))) + (synopsis "Container runtime") + (description "This package provides the container daemon for Docker. +It includes image transfer and storage, container execution and supervision, +network attachments.") + (home-page "http://containerd.io/") + (license license:asl2.0)))