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