From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:43317) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gcqGl-0008Da-Gm for guix-patches@gnu.org; Fri, 28 Dec 2018 06:25:37 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gcq33-0001WQ-Mu for guix-patches@gnu.org; Fri, 28 Dec 2018 06:11:28 -0500 Received: from debbugs.gnu.org ([208.118.235.43]:43979) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gcpDO-0008Mi-M9 for guix-patches@gnu.org; Fri, 28 Dec 2018 05:18:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gcpDO-0001Jf-Go for guix-patches@gnu.org; Fri, 28 Dec 2018 05:18:02 -0500 Subject: [bug#33893] [PATCH 1/2] gnu: Add docker-engine. Resent-Message-ID: From: Danny Milosavljevic Date: Fri, 28 Dec 2018 11:17:50 +0100 Message-Id: <20181228101751.676-1-dannym@scratchpost.org> In-Reply-To: <20181228101311.30793-1-dannym@scratchpost.org> References: <20181228101311.30793-1-dannym@scratchpost.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 33893@debbugs.gnu.org * gnu/packages/docker.scm (%docker-version): New variable. (docker-engine): New variable. Export it. --- gnu/packages/docker.scm | 83 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) diff --git a/gnu/packages/docker.scm b/gnu/packages/docker.scm index c58f3f3ca..3d1a90fc7 100644 --- a/gnu/packages/docker.scm +++ b/gnu/packages/docker.scm @@ -23,12 +23,18 @@ #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) + #:use-module (guix build-system gnu) #: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)) +(define %docker-version "18.09.0") + (define-public python-docker-py (package (name "python-docker-py") @@ -142,3 +148,80 @@ 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 docker-engine + (package + (name "docker-engine") + (version %docker-version) + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/docker/engine.git") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "1liqbx58grqih6m8hz9y20y5waflv19pv15l3wl64skap2bsn21c")))) + (build-system gnu-build-system) + (arguments + `(#:modules + ((guix build gnu-build-system) + ((guix build go-build-system) #:prefix go:) + (guix build utils)) + #:imported-modules + (,@%gnu-build-system-modules + (guix build go-build-system)) + #:phases + (modify-phases %standard-phases + (replace 'configure + (lambda _ + (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version)) + (setenv "AUTO_GOPATH" "1") + ;; Respectively, strip the symbol table and debug + ;; information, and the DWARF symbol table. + (setenv "LDFLAGS" "-s -w") + ;; Our LD doesn't like the statically linked relocatable things + ;; that go produces, so install the dynamic version of + ;; dockerd instead. + ;(substitute* "hack/make/install-binary" + ; (("/binary-daemon") "/dynbinary-daemon")) + #t)) + (add-before 'build 'setup-environment + (assoc-ref go:%standard-phases 'setup-environment)) + (replace 'build + (lambda _ + ;(invoke "hack/make.sh" "binary") + ; FIXME: bash -c 'hack/validate/default && hack/make.sh' + (invoke "hack/make.sh" "dynbinary"))) + (replace 'check + (lambda _ + ; FIXME: Those don't find any of the go packages + ; needed. Probably GOPATH/GOROOT related. + ;(invoke "hack/test/unit") + #t)) + (replace 'install + (lambda* (#:key outputs #:allow-other-keys) + (let* ((out (assoc-ref outputs "out")) + (out-bin (string-append out "/bin"))) + (install-file "bundles/dynbinary-daemon/dockerd" out-bin) + (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)) + ;(setenv "DOCKER_MAKE_INSTALL_PREFIX" (assoc-ref outputs "out")) + ; TODO: KEEPBUNDLE=1 + ;./source/bundles/dynbinary-daemon/dockerd + ;(invoke "hack/make.sh" "install-binary") + #t))))) + (inputs + `(("btrfs-progs" ,btrfs-progs))) + (native-inputs + `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc) + ("go" ,go) + ("lvm2" ,lvm2) + ("pkg-config" ,pkg-config))) + (synopsis "Docker container component library") + (description "This package provides a framework to assemble specialized +container systems. It includes components for orchestration, image +management, secret management, configuration management, networking, +provisioning etc.") + (home-page "https://mobyproject.org/") + (license license:asl2.0)))