gnu: protobuf: Update to 3.11.3.
[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 (build-system go-build-system)
188 (arguments
189 `(#:import-path "github.com/containerd/containerd"
190 #:phases
191 (modify-phases %standard-phases
192 (add-before 'build 'chdir
193 (lambda _
194 (chdir "src/github.com/containerd/containerd")
195 #t))
196 (add-after 'chdir 'patch-paths
197 (lambda* (#:key inputs outputs #:allow-other-keys)
198 ;; TODO: Patch "socat", "unpigz".
199 (substitute* "./runtime/v1/linux/runtime.go"
200 (("defaultRuntime[ \t]*=.*")
201 (string-append "defaultRuntime = \""
202 (assoc-ref inputs "runc")
203 "/sbin/runc\"\n"))
204 (("defaultShim[ \t]*=.*")
205 (string-append "defaultShim = \""
206 (assoc-ref outputs "out")
207 "/bin/containerd-shim\"\n")))
208 (substitute* "./vendor/github.com/containerd/go-runc/runc.go"
209 (("DefaultCommand[ \t]*=.*")
210 (string-append "DefaultCommand = \""
211 (assoc-ref inputs "runc")
212 "/sbin/runc\"\n")))
213 (substitute* "vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go"
214 (("exec\\.Command\\(\"losetup\"") ; )
215 (string-append "exec.Command(\""
216 (assoc-ref inputs "util-linux")
217 "/sbin/losetup\""))) ;)
218 #t))
219 (replace 'build
220 (lambda* (#:key (make-flags '()) #:allow-other-keys)
221 (apply invoke "make" make-flags)))
222 (replace 'install
223 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
224 (let* ((out (assoc-ref outputs "out")))
225 (apply invoke "make" (string-append "DESTDIR=" out) "install"
226 make-flags)))))))
227 (inputs
228 `(("btrfs-progs" ,btrfs-progs)
229 ("libseccomp" ,libseccomp)
230 ("runc" ,runc)
231 ("util-linux" ,util-linux)))
232 (native-inputs
233 `(("go" ,go)
234 ("pkg-config" ,pkg-config)))
235 (synopsis "Docker container runtime")
236 (description "This package provides the container daemon for Docker.
237 It includes image transfer and storage, container execution and supervision,
238 network attachments.")
239 (home-page "http://containerd.io/")
240 (license license:asl2.0)))
241
242 ;;; Private package that shouldn't be used directly; its purposes is to be
243 ;;; used as a template for the various packages it contains. It doesn't build
244 ;;; anyway, as it needs many dependencies that aren't being satisfied.
245 (define docker-libnetwork
246 ;; There are no recent release for libnetwork, so choose the last commit of
247 ;; the branch that Docker uses, as can be seen in the Docker source file
248 ;; 'hack/dockerfile/install/proxy.installer'.
249 (let ((commit "4725f2163fb214a6312f3beae5991f838ec36326")
250 (version "18.09")
251 (revision "1"))
252 (package
253 (name "docker-libnetwork")
254 (version (git-version version "1" commit))
255 (source (origin
256 (method git-fetch)
257 (uri (git-reference
258 (url "https://github.com/docker/libnetwork.git")
259 (commit commit)))
260 (file-name (git-file-name name version))
261 (sha256
262 (base32
263 "1zpnxki8qfzha6ljahpwd3vkzmjhsvkmf73w6crm4ilxxw5vnpfb"))
264 ;; Delete bundled ("vendored") free software source code.
265 (modules '((guix build utils)))
266 (snippet '(begin
267 (delete-file-recursively "vendor")
268 #t))))
269 (build-system go-build-system)
270 (arguments
271 `(#:import-path "github.com/docker/libnetwork/"))
272 (home-page "https://github.com/docker/libnetwork/")
273 (synopsis "Networking for containers")
274 (description "Libnetwork provides a native Go implementation for
275 connecting containers. The goal of @code{libnetwork} is to deliver a robust
276 container network model that provides a consistent programming interface and
277 the required network abstractions for applications.")
278 (license license:asl2.0))))
279
280 (define-public docker-libnetwork-cmd-proxy
281 (package
282 (inherit docker-libnetwork)
283 (name "docker-libnetwork-cmd-proxy")
284 (arguments
285 `(#:import-path "github.com/docker/libnetwork/cmd/proxy"
286 #:unpack-path "github.com/docker/libnetwork"
287 #:install-source? #f))
288 (native-inputs
289 `(("go-sctp" ,go-sctp)
290 ;; For tests.
291 ("logrus" ,go-github-com-sirupsen-logrus)
292 ("go-netlink" ,go-netlink)
293 ("go-netns" ,go-netns)
294 ("go-golang-org-x-crypto"
295 ,go-golang-org-x-crypto)
296 ("go-golang-org-x-sys" ,go-golang-org-x-sys)))
297 (synopsis "Docker user-space proxy")
298 (description "A proxy running in the user space. It is used by the
299 built-in registry server of Docker.")
300 (license license:asl2.0)))
301
302 ;; TODO: Patch out modprobes for ip_vs, nf_conntrack,
303 ;; brige, nf_conntrack_netlink, aufs.
304 (define-public docker
305 (package
306 (name "docker")
307 (version %docker-version)
308 (source
309 (origin
310 (method git-fetch)
311 (uri (git-reference
312 (url "https://github.com/docker/engine.git")
313 (commit (string-append "v" version))))
314 (file-name (git-file-name name version))
315 (sha256
316 (base32 "1dlknwn0fh82nbzdzxdk6pfhqwph9vcw3vs3111wfr19y5hwncq9"))
317 (patches
318 (search-patches "docker-fix-tests.patch"))))
319 (build-system gnu-build-system)
320 (arguments
321 `(#:modules
322 ((guix build gnu-build-system)
323 ((guix build go-build-system) #:prefix go:)
324 (guix build union)
325 (guix build utils))
326 #:imported-modules
327 (,@%gnu-build-system-modules
328 (guix build union)
329 (guix build go-build-system))
330 #:phases
331 (modify-phases %standard-phases
332 (add-after 'unpack 'patch-paths
333 (lambda* (#:key inputs #:allow-other-keys)
334 (substitute* "builder/builder-next/executor_unix.go"
335 (("CommandCandidates:.*runc.*")
336 (string-append "CommandCandidates: []string{\""
337 (assoc-ref inputs "runc")
338 "/sbin/runc\"},\n")))
339 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
340 (("DefaultCommand = .*")
341 (string-append "DefaultCommand = \""
342 (assoc-ref inputs "runc")
343 "/sbin/runc\"\n")))
344 (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go"
345 (("defaultRuntime[ \t]*=.*")
346 (string-append "defaultRuntime = \""
347 (assoc-ref inputs "runc")
348 "/sbin/runc\"\n"))
349 (("defaultShim[ \t]*=.*")
350 (string-append "defaultShim = \""
351 (assoc-ref inputs "containerd")
352 "/bin/containerd-shim\"\n")))
353 (substitute* "daemon/daemon_unix.go"
354 (("DefaultShimBinary = .*")
355 (string-append "DefaultShimBinary = \""
356 (assoc-ref inputs "containerd")
357 "/bin/containerd-shim\"\n"))
358 (("DefaultRuntimeBinary = .*")
359 (string-append "DefaultRuntimeBinary = \""
360 (assoc-ref inputs "runc")
361 "/sbin/runc\"\n"))
362 (("DefaultRuntimeName = .*")
363 (string-append "DefaultRuntimeName = \""
364 (assoc-ref inputs "runc")
365 "/sbin/runc\"\n")))
366 (substitute* "daemon/config/config.go"
367 (("StockRuntimeName = .*")
368 (string-append "StockRuntimeName = \""
369 (assoc-ref inputs "runc")
370 "/sbin/runc\"\n"))
371 (("DefaultInitBinary = .*")
372 (string-append "DefaultInitBinary = \""
373 (assoc-ref inputs "tini")
374 "/bin/tini\"\n")))
375 (substitute* "daemon/config/config_common_unix_test.go"
376 (("expectedInitPath: \"docker-init\"")
377 (string-append "expectedInitPath: \""
378 (assoc-ref inputs "tini")
379 "/bin/tini\"")))
380 (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go"
381 (("var defaultCommandCandidates = .*")
382 (string-append "var defaultCommandCandidates = []string{\""
383 (assoc-ref inputs "runc") "/sbin/runc\"}")))
384 (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go"
385 (("var userlandProxyCommandName = .*")
386 (string-append "var userlandProxyCommandName = \""
387 (assoc-ref inputs "docker-proxy")
388 "/bin/proxy\"\n")))
389 (substitute* "pkg/archive/archive.go"
390 (("string\\{\"xz")
391 (string-append "string{\"" (assoc-ref inputs "xz") "/bin/xz")))
392 (let ((source-files (filter (lambda (name)
393 (not (string-contains name "test")))
394 (find-files "." "\\.go$"))))
395 (let-syntax ((substitute-LookPath*
396 (syntax-rules ()
397 ((_ (source-text package relative-path) ...)
398 (substitute* source-files
399 (((string-append "\\<exec\\.LookPath\\(\""
400 source-text
401 "\")"))
402 (string-append "\""
403 (assoc-ref inputs package)
404 "/" relative-path
405 "\", error(nil)")) ...))))
406 (substitute-Command*
407 (syntax-rules ()
408 ((_ (source-text package relative-path) ...)
409 (substitute* source-files
410 (((string-append "\\<(re)?exec\\.Command\\(\""
411 source-text
412 "\"") _ re?)
413 (string-append (if re? re? "")
414 "exec.Command(\""
415 (assoc-ref inputs package)
416 "/" relative-path
417 "\"")) ...)))))
418 (substitute-LookPath*
419 ("containerd" "containerd" "bin/containerd")
420 ("ps" "procps" "bin/ps")
421 ("mkfs.xfs" "xfsprogs" "bin/mkfs.xfs")
422 ("lvmdiskscan" "lvm2" "sbin/lvmdiskscan")
423 ("pvdisplay" "lvm2" "sbin/pvdisplay")
424 ("blkid" "util-linux" "sbin/blkid")
425 ("unpigz" "pigz" "bin/unpigz")
426 ("iptables" "iptables" "sbin/iptables")
427 ("iptables-legacy" "iptables" "sbin/iptables")
428 ("ip" "iproute2" "sbin/ip"))
429
430 (substitute-Command*
431 ("modprobe" "kmod" "bin/modprobe")
432 ("pvcreate" "lvm2" "sbin/pvcreate")
433 ("vgcreate" "lvm2" "sbin/vgcreate")
434 ("lvcreate" "lvm2" "sbin/lvcreate")
435 ("lvconvert" "lvm2" "sbin/lvconvert")
436 ("lvchange" "lvm2" "sbin/lvchange")
437 ("mkfs.xfs" "xfsprogs" "sbin/mkfs.xfs")
438 ("xfs_growfs" "xfsprogs" "sbin/xfs_growfs")
439 ("mkfs.ext4" "e2fsprogs" "sbin/mkfs.ext4")
440 ("tune2fs" "e2fsprogs" "sbin/tune2fs")
441 ("blkid" "util-linux" "sbin/blkid")
442 ("resize2fs" "e2fsprogs" "sbin/resize2fs")
443 ("ps" "procps" "bin/ps")
444 ("losetup" "util-linux" "sbin/losetup")
445 ("uname" "coreutils" "bin/uname")
446 ("dbus-launch" "dbus" "bin/dbus-launch")
447 ("git" "git" "bin/git")))
448 ;; docker-mountfrom ??
449 ;; docker
450 ;; docker-untar ??
451 ;; docker-applyLayer ??
452 ;; /usr/bin/uname
453 ;; grep
454 ;; apparmor_parser
455
456 ;; Make compilation fail when, in future versions, Docker
457 ;; invokes other programs we don't know about and thus don't
458 ;; substitute.
459 (substitute* source-files
460 ;; Search for Java in PATH.
461 (("\\<exec\\.Command\\(\"java\"")
462 "xxec.Command(\"java\"")
463 ;; Search for AUFS in PATH (mainline Linux doesn't support it).
464 (("\\<exec\\.Command\\(\"auplink\"")
465 "xxec.Command(\"auplink\"")
466 ;; Fail on other unsubstituted commands.
467 (("\\<exec\\.Command\\(\"([a-zA-Z0-9][a-zA-Z0-9_-]*)\""
468 _ executable)
469 (string-append "exec.Guix_doesnt_want_Command(\""
470 executable "\""))
471 (("\\<xxec\\.Command")
472 "exec.Command")
473 ;; Search for ZFS in PATH.
474 (("\\<LookPath\\(\"zfs\"\\)") "LooxPath(\"zfs\")")
475 ;; Fail on other unsubstituted LookPaths.
476 (("\\<LookPath\\(\"") "Guix_doesnt_want_LookPath\\(\"")
477 (("\\<LooxPath") "LookPath")))
478 #t))
479 (add-after 'patch-paths 'delete-failing-tests
480 (lambda _
481 ;; Needs internet access.
482 (delete-file "builder/remotecontext/git/gitutils_test.go")
483 ;; Permission denied.
484 (delete-file "daemon/graphdriver/devmapper/devmapper_test.go")
485 ;; Operation not permitted (idtools.MkdirAllAndChown).
486 (delete-file "daemon/graphdriver/vfs/vfs_test.go")
487 ;; Timeouts after 5 min.
488 (delete-file "plugin/manager_linux_test.go")
489 ;; Operation not permitted.
490 (delete-file "daemon/graphdriver/btrfs/btrfs_test.go")
491 (delete-file "daemon/graphdriver/overlay/overlay_test.go")
492 (delete-file "daemon/graphdriver/overlay2/overlay_test.go")
493 (delete-file "pkg/chrootarchive/archive_unix_test.go")
494 (delete-file "daemon/container_unix_test.go")
495 ;; This file uses cgroups and /proc.
496 (delete-file "pkg/sysinfo/sysinfo_linux_test.go")
497 ;; This file uses cgroups.
498 (delete-file "runconfig/config_test.go")
499 ;; This file uses /var.
500 (delete-file "daemon/oci_linux_test.go")
501 #t))
502 (replace 'configure
503 (lambda _
504 (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version))
505 ;; Automatically use bundled dependencies.
506 ;; TODO: Unbundle - see file "vendor.conf".
507 (setenv "AUTO_GOPATH" "1")
508 ;; Respectively, strip the symbol table and debug
509 ;; information, and the DWARF symbol table.
510 (setenv "LDFLAGS" "-s -w")
511 ;; Make build faster
512 (setenv "GOCACHE" "/tmp")
513 #t))
514 (add-before 'build 'setup-go-environment
515 (assoc-ref go:%standard-phases 'setup-go-environment))
516 (replace 'build
517 (lambda _
518 ;; Our LD doesn't like the statically linked relocatable things
519 ;; that go produces, so install the dynamic version of
520 ;; dockerd instead.
521 (invoke "hack/make.sh" "dynbinary")))
522 (replace 'check
523 (lambda _
524 ;; The build process generated a file because the environment
525 ;; variable "AUTO_GOPATH" was set. Use it.
526 (setenv "GOPATH" (string-append (getcwd) "/.gopath"))
527 ;; ".gopath/src/github.com/docker/docker" is a link to the current
528 ;; directory and chdir would canonicalize to that.
529 ;; But go needs to have the uncanonicalized directory name, so
530 ;; store that.
531 (setenv "PWD" (string-append (getcwd)
532 "/.gopath/src/github.com/docker/docker"))
533 (with-directory-excursion ".gopath/src/github.com/docker/docker"
534 (invoke "hack/test/unit"))
535 (setenv "PWD" #f)
536 #t))
537 (replace 'install
538 (lambda* (#:key outputs #:allow-other-keys)
539 (let* ((out (assoc-ref outputs "out"))
540 (out-bin (string-append out "/bin")))
541 (install-file "bundles/dynbinary-daemon/dockerd" out-bin)
542 (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)
543 #t))))))
544 (inputs
545 `(("btrfs-progs" ,btrfs-progs)
546 ("containerd" ,containerd) ; for containerd-shim
547 ("coreutils" ,coreutils)
548 ("dbus" ,dbus)
549 ("docker-proxy" ,docker-libnetwork-cmd-proxy)
550 ("e2fsprogs" ,e2fsprogs)
551 ("git" ,git)
552 ("iproute2" ,iproute)
553 ("iptables" ,iptables)
554 ("kmod" ,kmod)
555 ("libseccomp" ,libseccomp)
556 ("pigz" ,pigz)
557 ("procps" ,procps)
558 ("runc" ,runc)
559 ("util-linux" ,util-linux)
560 ("lvm2" ,lvm2)
561 ("tini" ,tini)
562 ("xfsprogs" ,xfsprogs)
563 ("xz" ,xz)))
564 (native-inputs
565 `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc)
566 ("go" ,go)
567 ("gotestsum" ,gotestsum)
568 ("pkg-config" ,pkg-config)))
569 (synopsis "Docker container component library, and daemon")
570 (description "This package provides a framework to assemble specialized
571 container systems. It includes components for orchestration, image
572 management, secret management, configuration management, networking,
573 provisioning etc.")
574 (home-page "https://mobyproject.org/")
575 (license license:asl2.0)))
576
577 (define-public docker-cli
578 (package
579 (name "docker-cli")
580 (version %docker-version)
581 (source
582 (origin
583 (method git-fetch)
584 (uri (git-reference
585 (url "https://github.com/docker/cli.git")
586 (commit (string-append "v" version))))
587 (file-name (git-file-name name version))
588 (sha256
589 (base32 "07ldz46y74b3la4ah65v5bzbfx09yy6kncvxrr0zfx0s1214ar3m"))))
590 (build-system go-build-system)
591 (arguments
592 `(#:import-path "github.com/docker/cli"
593 ;; TODO: Tests require a running Docker daemon.
594 #:tests? #f
595 #:phases
596 (modify-phases %standard-phases
597 (add-before 'build 'setup-environment-2
598 (lambda _
599 ;; Respectively, strip the symbol table and debug
600 ;; information, and the DWARF symbol table.
601 (setenv "LDFLAGS" "-s -w")
602
603 ;; Make sure "docker -v" prints a usable version string.
604 (setenv "VERSION" ,%docker-version)
605
606 ;; Make build reproducible.
607 (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00")
608 (symlink "src/github.com/docker/cli/scripts" "./scripts")
609 (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile")
610 #t))
611 (replace 'build
612 (lambda _
613 (invoke "./scripts/build/dynbinary")))
614 (replace 'check
615 (lambda* (#:key make-flags tests? #:allow-other-keys)
616 (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH")))
617 (if tests?
618 ;; Use the newly-built docker client for the tests.
619 (with-directory-excursion "src/github.com/docker/cli"
620 ;; TODO: Run test-e2e as well?
621 (apply invoke "make" "-f" "docker.Makefile" "test-unit"
622 (or make-flags '())))
623 #t)))
624 (replace 'install
625 (lambda* (#:key outputs #:allow-other-keys)
626 (let* ((out (assoc-ref outputs "out"))
627 (out-bin (string-append out "/bin"))
628 (etc (string-append out "/etc")))
629 (with-directory-excursion "src/github.com/docker/cli/contrib/completion"
630 (install-file "bash/docker"
631 (string-append etc "/bash_completion.d"))
632 (install-file "fish/docker.fish"
633 (string-append etc "/fish/completions"))
634 (install-file "zsh/_docker"
635 (string-append etc "/zsh/site-functions")))
636 (chdir "build")
637 (install-file "docker" out-bin)
638 #t))))))
639 (native-inputs
640 `(("go" ,go)
641 ("libltdl" ,libltdl)
642 ("pkg-config" ,pkg-config)))
643 (synopsis "Command line interface to Docker")
644 (description "This package provides a command line interface to Docker.")
645 (home-page "https://www.docker.com/")
646 (license license:asl2.0)))
647
648 (define-public cqfd
649 (package
650 (name "cqfd")
651 (version "5.1.0")
652 (source (origin
653 (method git-fetch)
654 (uri (git-reference
655 (url "https://github.com/savoirfairelinux/cqfd.git")
656 (commit (string-append "v" version))))
657 (file-name (git-file-name name version))
658 (sha256
659 (base32
660 "1xhydz01f2rrnw7rmnaxh3f3q1ariq7j2ig0i0w1p3wn10l3q0nv"))))
661 (build-system gnu-build-system)
662 (arguments
663 ;; The test suite requires a docker daemon and connectivity.
664 `(#:tests? #f
665 #:phases
666 (modify-phases %standard-phases
667 (delete 'configure)
668 (delete 'build)
669 (replace 'install
670 (lambda* (#:key outputs #:allow-other-keys)
671 (let ((out (assoc-ref outputs "out")))
672 ;; Fix the directory of the bash completion.
673 (substitute* "Makefile"
674 (("completionsdir=.*$")
675 (string-append "completionsdir=" out
676 "/etc/bash_completion.d; \\\n")))
677 (invoke "make" "install"
678 (string-append "PREFIX=" out))))))))
679 (home-page "https://github.com/savoirfairelinux/cqfd")
680 (synopsis "Convenience wrapper for Docker")
681 (description "cqfd is a Bash script that provides a quick and convenient
682 way to run commands in the current directory, but within a Docker container
683 defined in a per-project configuration file.")
684 (license license:gpl3+)))
685
686 (define-public tini
687 (package
688 (name "tini")
689 (version "0.18.0")
690 (source (origin
691 (method git-fetch)
692 (uri (git-reference
693 (url "https://github.com/krallin/tini.git")
694 (commit (string-append "v" version))))
695 (file-name (git-file-name name version))
696 (sha256
697 (base32
698 "1h20i3wwlbd8x4jr2gz68hgklh0lb0jj7y5xk1wvr8y58fip1rdn"))))
699 (build-system cmake-build-system)
700 (arguments
701 `(#:tests? #f ;tests require a Docker daemon
702 #:phases (modify-phases %standard-phases
703 (add-after 'unpack 'disable-static-build
704 ;; Disable the static build as it fails to install, with
705 ;; the error: "No valid ELF RPATH or RUNPATH entry exists
706 ;; in the file".
707 (lambda _
708 (substitute* "CMakeLists.txt"
709 ((".*tini-static.*") ""))
710 #t)))))
711 (home-page "https://github.com/krallin/tini")
712 (synopsis "Tiny but valid init for containers")
713 (description "Tini is an init program specifically designed for use with
714 containers. It manages a single child process and ensures that any zombie
715 processes produced from it are reaped and that signals are properly forwarded.
716 Tini is integrated with Docker.")
717 (license license:expat)))