gnu: emacs-sly: Update to 20200228.
[jackhill/guix/guix.git] / gnu / packages / docker.scm
1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2016 David Thompson <davet@gnu.org>
3 ;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
4 ;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
5 ;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
6 ;;;
7 ;;; This file is part of GNU Guix.
8 ;;;
9 ;;; GNU Guix is free software; you can redistribute it and/or modify it
10 ;;; under the terms of the GNU General Public License as published by
11 ;;; the Free Software Foundation; either version 3 of the License, or (at
12 ;;; your option) any later version.
13 ;;;
14 ;;; GNU Guix is distributed in the hope that it will be useful, but
15 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
16 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 ;;; GNU General Public License for more details.
18 ;;;
19 ;;; You should have received a copy of the GNU General Public License
20 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
21
22 (define-module (gnu packages docker)
23 #:use-module ((guix licenses) #:prefix license:)
24 #:use-module (gnu packages)
25 #:use-module (guix packages)
26 #:use-module (guix download)
27 #:use-module (guix git-download)
28 #:use-module (guix build-system cmake)
29 #:use-module (guix build-system gnu)
30 #:use-module (guix build-system go)
31 #:use-module (guix build-system python)
32 #:use-module (guix utils)
33 #:use-module (gnu packages autotools)
34 #:use-module (gnu packages base)
35 #:use-module (gnu packages check)
36 #:use-module (gnu packages compression)
37 #:use-module (gnu packages glib)
38 #:use-module (gnu packages golang)
39 #:use-module (gnu packages linux)
40 #:use-module (gnu packages networking)
41 #:use-module (gnu packages pkg-config)
42 #:use-module (gnu packages python)
43 #:use-module (gnu packages python-crypto)
44 #:use-module (gnu packages python-web)
45 #:use-module (gnu packages python-xyz)
46 #:use-module (gnu packages version-control)
47 #:use-module (gnu packages virtualization))
48
49 (define %docker-version "19.03.5")
50
51 (define-public python-docker-py
52 (package
53 (name "python-docker-py")
54 (version "3.7.3")
55 (source
56 (origin
57 (method url-fetch)
58 (uri (pypi-uri "docker" version))
59 (sha256
60 (base32
61 "0qmrcvpaz37p85hfddsd4yc8hgqlkzs4cz09q9wmy0pz5pwajqm0"))))
62 (build-system python-build-system)
63 ;; TODO: Tests require a running Docker daemon.
64 (arguments '(#:tests? #f))
65 (inputs
66 `(("python-requests" ,python-requests-2.20)
67 ("python-ipaddress" ,python-ipaddress)
68 ("python-six" ,python-six)
69 ("python-urllib3" ,python-urllib3-1.24)
70 ("python-websocket-client" ,python-websocket-client)))
71 (propagated-inputs
72 `(("python-docker-pycreds" ,python-docker-pycreds)
73 ("python-paramiko" ,python-paramiko))) ; adds SSH support
74 (home-page "https://github.com/docker/docker-py/")
75 (synopsis "Python client for Docker")
76 (description "Docker-Py is a Python client for the Docker container
77 management tool.")
78 (license license:asl2.0)))
79
80 (define-public python-dockerpty
81 (package
82 (name "python-dockerpty")
83 (version "0.4.1")
84 (source
85 (origin
86 (method url-fetch)
87 (uri (pypi-uri "dockerpty" version))
88 (sha256
89 (base32
90 "1kjn64wx23jmr8dcc6g7bwlmrhfmxr77gh6iphqsl39sayfxdab9"))))
91 (build-system python-build-system)
92 (native-inputs
93 `(("python-six" ,python-six)))
94 (home-page "https://github.com/d11wtq/dockerpty")
95 (synopsis "Python library to use the pseudo-TTY of a Docker container")
96 (description "Docker PTY provides the functionality needed to operate the
97 pseudo-terminal (PTY) allocated to a Docker container using the Python
98 client.")
99 (license license:asl2.0)))
100
101 ;; When updating, check whether python-jsonschema-2.6 can be removed from Guix
102 ;; entirely.
103 (define-public docker-compose
104 (package
105 (name "docker-compose")
106 (version "1.24.1")
107 (source
108 (origin
109 (method url-fetch)
110 (uri (pypi-uri "docker-compose" version))
111 (sha256
112 (base32
113 "0lx7bx6jvhydbab8vwry0bclhdf0dfj6jrns1m5y45yp9ybqxmd5"))))
114 (build-system python-build-system)
115 ;; TODO: Tests require running Docker daemon.
116 (arguments '(#:tests? #f))
117 (inputs
118 `(("python-cached-property"
119 ,python-cached-property)
120 ("python-docker-py" ,python-docker-py)
121 ("python-dockerpty" ,python-dockerpty)
122 ("python-docopt" ,python-docopt)
123 ("python-jsonschema" ,python-jsonschema-2.6)
124 ("python-pyyaml" ,python-pyyaml)
125 ("python-requests" ,python-requests-2.20)
126 ("python-six" ,python-six)
127 ("python-texttable" ,python-texttable)
128 ("python-websocket-client" ,python-websocket-client)))
129 (home-page "https://www.docker.com/")
130 (synopsis "Multi-container orchestration for Docker")
131 (description "Docker Compose is a tool for defining and running
132 multi-container Docker applications. A Compose file is used to configure an
133 application’s services. Then, using a single command, the containers are
134 created and all the services are started as specified in the configuration.")
135 (license license:asl2.0)))
136
137 (define-public python-docker-pycreds
138 (package
139 (name "python-docker-pycreds")
140 (version "0.4.0")
141 (source
142 (origin
143 (method url-fetch)
144 (uri (pypi-uri "docker-pycreds" version))
145 (sha256
146 (base32
147 "1m44smrggnqghxkqfl7vhapdw89m1p3vdr177r6cq17lr85jgqvc"))))
148 (build-system python-build-system)
149 (arguments
150 `(#:phases
151 (modify-phases %standard-phases
152 (add-after 'unpack 'fix-versioning
153 (lambda _
154 (substitute* "test-requirements.txt"
155 (("3.0.2") ,(package-version python-pytest))
156 (("2.3.1") ,(package-version python-pytest-cov))
157 (("2.4.1") ,(package-version python-flake8)))
158 #t)))))
159 (native-inputs
160 `(("python-flake8" ,python-flake8)
161 ("python-pytest" ,python-pytest)
162 ("python-pytest-cov" ,python-pytest-cov)))
163 (propagated-inputs
164 `(("python-six" ,python-six)))
165 (home-page "https://github.com/shin-/dockerpy-creds")
166 (synopsis
167 "Python bindings for the Docker credentials store API")
168 (description
169 "Docker-Pycreds contains the Python bindings for the docker credentials
170 store API. It allows programmers to interact with a Docker registry using
171 Python without keeping their credentials in a Docker configuration file.")
172 (license license:asl2.0)))
173
174 (define-public containerd
175 (package
176 (name "containerd")
177 (version "1.2.5")
178 (source
179 (origin
180 (method git-fetch)
181 (uri (git-reference
182 (url "https://github.com/containerd/containerd.git")
183 (commit (string-append "v" version))))
184 (file-name (git-file-name name version))
185 (sha256
186 (base32 "0npbzixf3c0jvzm159vygvkydrr8h36c9sq50yv0mdinrys2bvg0"))
187 (patches
188 (search-patches "containerd-test-with-go1.13.patch"))))
189 (build-system go-build-system)
190 (arguments
191 `(#:import-path "github.com/containerd/containerd"
192 #:phases
193 (modify-phases %standard-phases
194 (add-before 'build 'chdir
195 (lambda _
196 (chdir "src/github.com/containerd/containerd")
197 #t))
198 (add-after 'chdir 'patch-paths
199 (lambda* (#:key inputs outputs #:allow-other-keys)
200 ;; TODO: Patch "socat", "unpigz".
201 (substitute* "./runtime/v1/linux/runtime.go"
202 (("defaultRuntime[ \t]*=.*")
203 (string-append "defaultRuntime = \""
204 (assoc-ref inputs "runc")
205 "/sbin/runc\"\n"))
206 (("defaultShim[ \t]*=.*")
207 (string-append "defaultShim = \""
208 (assoc-ref outputs "out")
209 "/bin/containerd-shim\"\n")))
210 (substitute* "./vendor/github.com/containerd/go-runc/runc.go"
211 (("DefaultCommand[ \t]*=.*")
212 (string-append "DefaultCommand = \""
213 (assoc-ref inputs "runc")
214 "/sbin/runc\"\n")))
215 (substitute* "vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go"
216 (("exec\\.Command\\(\"losetup\"") ; )
217 (string-append "exec.Command(\""
218 (assoc-ref inputs "util-linux")
219 "/sbin/losetup\""))) ;)
220 #t))
221 (replace 'build
222 (lambda* (#:key (make-flags '()) #:allow-other-keys)
223 (apply invoke "make" make-flags)))
224 (replace 'install
225 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
226 (let* ((out (assoc-ref outputs "out")))
227 (apply invoke "make" (string-append "DESTDIR=" out) "install"
228 make-flags)))))))
229 (inputs
230 `(("btrfs-progs" ,btrfs-progs)
231 ("libseccomp" ,libseccomp)
232 ("runc" ,runc)
233 ("util-linux" ,util-linux)))
234 (native-inputs
235 `(("go" ,go)
236 ("pkg-config" ,pkg-config)))
237 (synopsis "Docker container runtime")
238 (description "This package provides the container daemon for Docker.
239 It includes image transfer and storage, container execution and supervision,
240 network attachments.")
241 (home-page "https://containerd.io/")
242 (license license:asl2.0)))
243
244 ;;; Private package that shouldn't be used directly; its purposes is to be
245 ;;; used as a template for the various packages it contains. It doesn't build
246 ;;; anyway, as it needs many dependencies that aren't being satisfied.
247 (define docker-libnetwork
248 ;; There are no recent release for libnetwork, so choose the last commit of
249 ;; the branch that Docker uses, as can be seen in the Docker source file
250 ;; 'hack/dockerfile/install/proxy.installer'.
251 (let ((commit "4725f2163fb214a6312f3beae5991f838ec36326")
252 (version "18.09")
253 (revision "1"))
254 (package
255 (name "docker-libnetwork")
256 (version (git-version version "1" commit))
257 (source (origin
258 (method git-fetch)
259 (uri (git-reference
260 (url "https://github.com/docker/libnetwork.git")
261 (commit commit)))
262 (file-name (git-file-name name version))
263 (sha256
264 (base32
265 "1zpnxki8qfzha6ljahpwd3vkzmjhsvkmf73w6crm4ilxxw5vnpfb"))
266 ;; Delete bundled ("vendored") free software source code.
267 (modules '((guix build utils)))
268 (snippet '(begin
269 (delete-file-recursively "vendor")
270 #t))))
271 (build-system go-build-system)
272 (arguments
273 `(#:import-path "github.com/docker/libnetwork/"))
274 (home-page "https://github.com/docker/libnetwork/")
275 (synopsis "Networking for containers")
276 (description "Libnetwork provides a native Go implementation for
277 connecting containers. The goal of @code{libnetwork} is to deliver a robust
278 container network model that provides a consistent programming interface and
279 the required network abstractions for applications.")
280 (license license:asl2.0))))
281
282 (define-public docker-libnetwork-cmd-proxy
283 (package
284 (inherit docker-libnetwork)
285 (name "docker-libnetwork-cmd-proxy")
286 (arguments
287 `(#:import-path "github.com/docker/libnetwork/cmd/proxy"
288 #:unpack-path "github.com/docker/libnetwork"
289 #:install-source? #f))
290 (native-inputs
291 `(("go-sctp" ,go-sctp)
292 ;; For tests.
293 ("logrus" ,go-github-com-sirupsen-logrus)
294 ("go-netlink" ,go-netlink)
295 ("go-netns" ,go-netns)
296 ("go-golang-org-x-crypto"
297 ,go-golang-org-x-crypto)
298 ("go-golang-org-x-sys" ,go-golang-org-x-sys)))
299 (synopsis "Docker user-space proxy")
300 (description "A proxy running in the user space. It is used by the
301 built-in registry server of Docker.")
302 (license license:asl2.0)))
303
304 ;; TODO: Patch out modprobes for ip_vs, nf_conntrack,
305 ;; brige, nf_conntrack_netlink, aufs.
306 (define-public docker
307 (package
308 (name "docker")
309 (version %docker-version)
310 (source
311 (origin
312 (method git-fetch)
313 (uri (git-reference
314 (url "https://github.com/docker/engine.git")
315 (commit (string-append "v" version))))
316 (file-name (git-file-name name version))
317 (sha256
318 (base32 "1dlknwn0fh82nbzdzxdk6pfhqwph9vcw3vs3111wfr19y5hwncq9"))
319 (patches
320 (search-patches "docker-fix-tests.patch"))))
321 (build-system gnu-build-system)
322 (arguments
323 `(#:modules
324 ((guix build gnu-build-system)
325 ((guix build go-build-system) #:prefix go:)
326 (guix build union)
327 (guix build utils))
328 #:imported-modules
329 (,@%gnu-build-system-modules
330 (guix build union)
331 (guix build go-build-system))
332 #:phases
333 (modify-phases %standard-phases
334 (add-after 'unpack 'patch-paths
335 (lambda* (#:key inputs #:allow-other-keys)
336 (substitute* "builder/builder-next/executor_unix.go"
337 (("CommandCandidates:.*runc.*")
338 (string-append "CommandCandidates: []string{\""
339 (assoc-ref inputs "runc")
340 "/sbin/runc\"},\n")))
341 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
342 (("DefaultCommand = .*")
343 (string-append "DefaultCommand = \""
344 (assoc-ref inputs "runc")
345 "/sbin/runc\"\n")))
346 (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go"
347 (("defaultRuntime[ \t]*=.*")
348 (string-append "defaultRuntime = \""
349 (assoc-ref inputs "runc")
350 "/sbin/runc\"\n"))
351 (("defaultShim[ \t]*=.*")
352 (string-append "defaultShim = \""
353 (assoc-ref inputs "containerd")
354 "/bin/containerd-shim\"\n")))
355 (substitute* "daemon/daemon_unix.go"
356 (("DefaultShimBinary = .*")
357 (string-append "DefaultShimBinary = \""
358 (assoc-ref inputs "containerd")
359 "/bin/containerd-shim\"\n"))
360 (("DefaultRuntimeBinary = .*")
361 (string-append "DefaultRuntimeBinary = \""
362 (assoc-ref inputs "runc")
363 "/sbin/runc\"\n"))
364 (("DefaultRuntimeName = .*")
365 (string-append "DefaultRuntimeName = \""
366 (assoc-ref inputs "runc")
367 "/sbin/runc\"\n")))
368 (substitute* "daemon/config/config.go"
369 (("StockRuntimeName = .*")
370 (string-append "StockRuntimeName = \""
371 (assoc-ref inputs "runc")
372 "/sbin/runc\"\n"))
373 (("DefaultInitBinary = .*")
374 (string-append "DefaultInitBinary = \""
375 (assoc-ref inputs "tini")
376 "/bin/tini\"\n")))
377 (substitute* "daemon/config/config_common_unix_test.go"
378 (("expectedInitPath: \"docker-init\"")
379 (string-append "expectedInitPath: \""
380 (assoc-ref inputs "tini")
381 "/bin/tini\"")))
382 (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go"
383 (("var defaultCommandCandidates = .*")
384 (string-append "var defaultCommandCandidates = []string{\""
385 (assoc-ref inputs "runc") "/sbin/runc\"}")))
386 (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go"
387 (("var userlandProxyCommandName = .*")
388 (string-append "var userlandProxyCommandName = \""
389 (assoc-ref inputs "docker-proxy")
390 "/bin/proxy\"\n")))
391 (substitute* "pkg/archive/archive.go"
392 (("string\\{\"xz")
393 (string-append "string{\"" (assoc-ref inputs "xz") "/bin/xz")))
394 (let ((source-files (filter (lambda (name)
395 (not (string-contains name "test")))
396 (find-files "." "\\.go$"))))
397 (let-syntax ((substitute-LookPath*
398 (syntax-rules ()
399 ((_ (source-text package relative-path) ...)
400 (substitute* source-files
401 (((string-append "\\<exec\\.LookPath\\(\""
402 source-text
403 "\")"))
404 (string-append "\""
405 (assoc-ref inputs package)
406 "/" relative-path
407 "\", error(nil)")) ...))))
408 (substitute-Command*
409 (syntax-rules ()
410 ((_ (source-text package relative-path) ...)
411 (substitute* source-files
412 (((string-append "\\<(re)?exec\\.Command\\(\""
413 source-text
414 "\"") _ re?)
415 (string-append (if re? re? "")
416 "exec.Command(\""
417 (assoc-ref inputs package)
418 "/" relative-path
419 "\"")) ...)))))
420 (substitute-LookPath*
421 ("containerd" "containerd" "bin/containerd")
422 ("ps" "procps" "bin/ps")
423 ("mkfs.xfs" "xfsprogs" "bin/mkfs.xfs")
424 ("lvmdiskscan" "lvm2" "sbin/lvmdiskscan")
425 ("pvdisplay" "lvm2" "sbin/pvdisplay")
426 ("blkid" "util-linux" "sbin/blkid")
427 ("unpigz" "pigz" "bin/unpigz")
428 ("iptables" "iptables" "sbin/iptables")
429 ("iptables-legacy" "iptables" "sbin/iptables")
430 ("ip" "iproute2" "sbin/ip"))
431
432 (substitute-Command*
433 ("modprobe" "kmod" "bin/modprobe")
434 ("pvcreate" "lvm2" "sbin/pvcreate")
435 ("vgcreate" "lvm2" "sbin/vgcreate")
436 ("lvcreate" "lvm2" "sbin/lvcreate")
437 ("lvconvert" "lvm2" "sbin/lvconvert")
438 ("lvchange" "lvm2" "sbin/lvchange")
439 ("mkfs.xfs" "xfsprogs" "sbin/mkfs.xfs")
440 ("xfs_growfs" "xfsprogs" "sbin/xfs_growfs")
441 ("mkfs.ext4" "e2fsprogs" "sbin/mkfs.ext4")
442 ("tune2fs" "e2fsprogs" "sbin/tune2fs")
443 ("blkid" "util-linux" "sbin/blkid")
444 ("resize2fs" "e2fsprogs" "sbin/resize2fs")
445 ("ps" "procps" "bin/ps")
446 ("losetup" "util-linux" "sbin/losetup")
447 ("uname" "coreutils" "bin/uname")
448 ("dbus-launch" "dbus" "bin/dbus-launch")
449 ("git" "git" "bin/git")))
450 ;; docker-mountfrom ??
451 ;; docker
452 ;; docker-untar ??
453 ;; docker-applyLayer ??
454 ;; /usr/bin/uname
455 ;; grep
456 ;; apparmor_parser
457
458 ;; Make compilation fail when, in future versions, Docker
459 ;; invokes other programs we don't know about and thus don't
460 ;; substitute.
461 (substitute* source-files
462 ;; Search for Java in PATH.
463 (("\\<exec\\.Command\\(\"java\"")
464 "xxec.Command(\"java\"")
465 ;; Search for AUFS in PATH (mainline Linux doesn't support it).
466 (("\\<exec\\.Command\\(\"auplink\"")
467 "xxec.Command(\"auplink\"")
468 ;; Fail on other unsubstituted commands.
469 (("\\<exec\\.Command\\(\"([a-zA-Z0-9][a-zA-Z0-9_-]*)\""
470 _ executable)
471 (string-append "exec.Guix_doesnt_want_Command(\""
472 executable "\""))
473 (("\\<xxec\\.Command")
474 "exec.Command")
475 ;; Search for ZFS in PATH.
476 (("\\<LookPath\\(\"zfs\"\\)") "LooxPath(\"zfs\")")
477 ;; Fail on other unsubstituted LookPaths.
478 (("\\<LookPath\\(\"") "Guix_doesnt_want_LookPath\\(\"")
479 (("\\<LooxPath") "LookPath")))
480 #t))
481 (add-after 'patch-paths 'delete-failing-tests
482 (lambda _
483 ;; Needs internet access.
484 (delete-file "builder/remotecontext/git/gitutils_test.go")
485 ;; Permission denied.
486 (delete-file "daemon/graphdriver/devmapper/devmapper_test.go")
487 ;; Operation not permitted (idtools.MkdirAllAndChown).
488 (delete-file "daemon/graphdriver/vfs/vfs_test.go")
489 ;; Timeouts after 5 min.
490 (delete-file "plugin/manager_linux_test.go")
491 ;; Operation not permitted.
492 (delete-file "daemon/graphdriver/btrfs/btrfs_test.go")
493 (delete-file "daemon/graphdriver/overlay/overlay_test.go")
494 (delete-file "daemon/graphdriver/overlay2/overlay_test.go")
495 (delete-file "pkg/chrootarchive/archive_unix_test.go")
496 (delete-file "daemon/container_unix_test.go")
497 ;; This file uses cgroups and /proc.
498 (delete-file "pkg/sysinfo/sysinfo_linux_test.go")
499 ;; This file uses cgroups.
500 (delete-file "runconfig/config_test.go")
501 ;; This file uses /var.
502 (delete-file "daemon/oci_linux_test.go")
503 #t))
504 (replace 'configure
505 (lambda _
506 (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version))
507 ;; Automatically use bundled dependencies.
508 ;; TODO: Unbundle - see file "vendor.conf".
509 (setenv "AUTO_GOPATH" "1")
510 ;; Respectively, strip the symbol table and debug
511 ;; information, and the DWARF symbol table.
512 (setenv "LDFLAGS" "-s -w")
513 ;; Make build faster
514 (setenv "GOCACHE" "/tmp")
515 #t))
516 (add-before 'build 'setup-go-environment
517 (assoc-ref go:%standard-phases 'setup-go-environment))
518 (replace 'build
519 (lambda _
520 ;; Our LD doesn't like the statically linked relocatable things
521 ;; that go produces, so install the dynamic version of
522 ;; dockerd instead.
523 (invoke "hack/make.sh" "dynbinary")))
524 (replace 'check
525 (lambda _
526 ;; The build process generated a file because the environment
527 ;; variable "AUTO_GOPATH" was set. Use it.
528 (setenv "GOPATH" (string-append (getcwd) "/.gopath"))
529 ;; ".gopath/src/github.com/docker/docker" is a link to the current
530 ;; directory and chdir would canonicalize to that.
531 ;; But go needs to have the uncanonicalized directory name, so
532 ;; store that.
533 (setenv "PWD" (string-append (getcwd)
534 "/.gopath/src/github.com/docker/docker"))
535 (with-directory-excursion ".gopath/src/github.com/docker/docker"
536 (invoke "hack/test/unit"))
537 (setenv "PWD" #f)
538 #t))
539 (replace 'install
540 (lambda* (#:key outputs #:allow-other-keys)
541 (let* ((out (assoc-ref outputs "out"))
542 (out-bin (string-append out "/bin")))
543 (install-file "bundles/dynbinary-daemon/dockerd" out-bin)
544 (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)
545 #t))))))
546 (inputs
547 `(("btrfs-progs" ,btrfs-progs)
548 ("containerd" ,containerd) ; for containerd-shim
549 ("coreutils" ,coreutils)
550 ("dbus" ,dbus)
551 ("docker-proxy" ,docker-libnetwork-cmd-proxy)
552 ("e2fsprogs" ,e2fsprogs)
553 ("git" ,git)
554 ("iproute2" ,iproute)
555 ("iptables" ,iptables)
556 ("kmod" ,kmod)
557 ("libseccomp" ,libseccomp)
558 ("pigz" ,pigz)
559 ("procps" ,procps)
560 ("runc" ,runc)
561 ("util-linux" ,util-linux)
562 ("lvm2" ,lvm2)
563 ("tini" ,tini)
564 ("xfsprogs" ,xfsprogs)
565 ("xz" ,xz)))
566 (native-inputs
567 `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc)
568 ("go" ,go)
569 ("gotestsum" ,gotestsum)
570 ("pkg-config" ,pkg-config)))
571 (synopsis "Docker container component library, and daemon")
572 (description "This package provides a framework to assemble specialized
573 container systems. It includes components for orchestration, image
574 management, secret management, configuration management, networking,
575 provisioning etc.")
576 (home-page "https://mobyproject.org/")
577 (license license:asl2.0)))
578
579 (define-public docker-cli
580 (package
581 (name "docker-cli")
582 (version %docker-version)
583 (source
584 (origin
585 (method git-fetch)
586 (uri (git-reference
587 (url "https://github.com/docker/cli.git")
588 (commit (string-append "v" version))))
589 (file-name (git-file-name name version))
590 (sha256
591 (base32 "07ldz46y74b3la4ah65v5bzbfx09yy6kncvxrr0zfx0s1214ar3m"))))
592 (build-system go-build-system)
593 (arguments
594 `(#:import-path "github.com/docker/cli"
595 ;; TODO: Tests require a running Docker daemon.
596 #:tests? #f
597 #:phases
598 (modify-phases %standard-phases
599 (add-before 'build 'setup-environment-2
600 (lambda _
601 ;; Respectively, strip the symbol table and debug
602 ;; information, and the DWARF symbol table.
603 (setenv "LDFLAGS" "-s -w")
604
605 ;; Make sure "docker -v" prints a usable version string.
606 (setenv "VERSION" ,%docker-version)
607
608 ;; Make build reproducible.
609 (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00")
610 (symlink "src/github.com/docker/cli/scripts" "./scripts")
611 (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile")
612 #t))
613 (replace 'build
614 (lambda _
615 (invoke "./scripts/build/dynbinary")))
616 (replace 'check
617 (lambda* (#:key make-flags tests? #:allow-other-keys)
618 (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH")))
619 (if tests?
620 ;; Use the newly-built docker client for the tests.
621 (with-directory-excursion "src/github.com/docker/cli"
622 ;; TODO: Run test-e2e as well?
623 (apply invoke "make" "-f" "docker.Makefile" "test-unit"
624 (or make-flags '())))
625 #t)))
626 (replace 'install
627 (lambda* (#:key outputs #:allow-other-keys)
628 (let* ((out (assoc-ref outputs "out"))
629 (out-bin (string-append out "/bin"))
630 (etc (string-append out "/etc")))
631 (with-directory-excursion "src/github.com/docker/cli/contrib/completion"
632 (install-file "bash/docker"
633 (string-append etc "/bash_completion.d"))
634 (install-file "fish/docker.fish"
635 (string-append etc "/fish/completions"))
636 (install-file "zsh/_docker"
637 (string-append etc "/zsh/site-functions")))
638 (chdir "build")
639 (install-file "docker" out-bin)
640 #t))))))
641 (native-inputs
642 `(("go" ,go)
643 ("libltdl" ,libltdl)
644 ("pkg-config" ,pkg-config)))
645 (synopsis "Command line interface to Docker")
646 (description "This package provides a command line interface to Docker.")
647 (home-page "https://www.docker.com/")
648 (license license:asl2.0)))
649
650 (define-public cqfd
651 (package
652 (name "cqfd")
653 (version "5.1.0")
654 (source (origin
655 (method git-fetch)
656 (uri (git-reference
657 (url "https://github.com/savoirfairelinux/cqfd.git")
658 (commit (string-append "v" version))))
659 (file-name (git-file-name name version))
660 (sha256
661 (base32
662 "1xhydz01f2rrnw7rmnaxh3f3q1ariq7j2ig0i0w1p3wn10l3q0nv"))))
663 (build-system gnu-build-system)
664 (arguments
665 ;; The test suite requires a docker daemon and connectivity.
666 `(#:tests? #f
667 #:phases
668 (modify-phases %standard-phases
669 (delete 'configure)
670 (delete 'build)
671 (replace 'install
672 (lambda* (#:key outputs #:allow-other-keys)
673 (let ((out (assoc-ref outputs "out")))
674 ;; Fix the directory of the bash completion.
675 (substitute* "Makefile"
676 (("completionsdir=.*$")
677 (string-append "completionsdir=" out
678 "/etc/bash_completion.d; \\\n")))
679 (invoke "make" "install"
680 (string-append "PREFIX=" out))))))))
681 (home-page "https://github.com/savoirfairelinux/cqfd")
682 (synopsis "Convenience wrapper for Docker")
683 (description "cqfd is a Bash script that provides a quick and convenient
684 way to run commands in the current directory, but within a Docker container
685 defined in a per-project configuration file.")
686 (license license:gpl3+)))
687
688 (define-public tini
689 (package
690 (name "tini")
691 (version "0.18.0")
692 (source (origin
693 (method git-fetch)
694 (uri (git-reference
695 (url "https://github.com/krallin/tini.git")
696 (commit (string-append "v" version))))
697 (file-name (git-file-name name version))
698 (sha256
699 (base32
700 "1h20i3wwlbd8x4jr2gz68hgklh0lb0jj7y5xk1wvr8y58fip1rdn"))))
701 (build-system cmake-build-system)
702 (arguments
703 `(#:tests? #f ;tests require a Docker daemon
704 #:phases (modify-phases %standard-phases
705 (add-after 'unpack 'disable-static-build
706 ;; Disable the static build as it fails to install, with
707 ;; the error: "No valid ELF RPATH or RUNPATH entry exists
708 ;; in the file".
709 (lambda _
710 (substitute* "CMakeLists.txt"
711 ((".*tini-static.*") ""))
712 #t)))))
713 (home-page "https://github.com/krallin/tini")
714 (synopsis "Tiny but valid init for containers")
715 (description "Tini is an init program specifically designed for use with
716 containers. It manages a single child process and ensures that any zombie
717 processes produced from it are reaped and that signals are properly forwarded.
718 Tini is integrated with Docker.")
719 (license license:expat)))