Merge branch 'staging' into core-updates
[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 "18.09.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 "0cirpd9l2qazp2jyanwzvrkx2m98nksjdvn43ff38p89w6133ipb"))
317 (patches
318 (search-patches "docker-engine-test-noinstall.patch"
319 "docker-fix-tests.patch"
320 "docker-use-fewer-modprobes.patch"
321 "docker-adjust-tests-for-changes-in-go.patch"))))
322 (build-system gnu-build-system)
323 (arguments
324 `(#:modules
325 ((guix build gnu-build-system)
326 ((guix build go-build-system) #:prefix go:)
327 (guix build union)
328 (guix build utils))
329 #:imported-modules
330 (,@%gnu-build-system-modules
331 (guix build union)
332 (guix build go-build-system))
333 #:phases
334 (modify-phases %standard-phases
335 (add-after 'unpack 'patch-paths
336 (lambda* (#:key inputs #:allow-other-keys)
337 (substitute* "builder/builder-next/executor_unix.go"
338 (("CommandCandidates:.*runc.*")
339 (string-append "CommandCandidates: []string{\""
340 (assoc-ref inputs "runc")
341 "/sbin/runc\"},\n")))
342 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
343 (("DefaultCommand = .*")
344 (string-append "DefaultCommand = \""
345 (assoc-ref inputs "runc")
346 "/sbin/runc\"\n")))
347 (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go"
348 (("defaultRuntime[ \t]*=.*")
349 (string-append "defaultRuntime = \""
350 (assoc-ref inputs "runc")
351 "/sbin/runc\"\n"))
352 (("defaultShim[ \t]*=.*")
353 (string-append "defaultShim = \""
354 (assoc-ref inputs "containerd")
355 "/bin/containerd-shim\"\n")))
356 (substitute* "daemon/daemon_unix.go"
357 (("DefaultShimBinary = .*")
358 (string-append "DefaultShimBinary = \""
359 (assoc-ref inputs "containerd")
360 "/bin/containerd-shim\"\n"))
361 (("DefaultRuntimeBinary = .*")
362 (string-append "DefaultRuntimeBinary = \""
363 (assoc-ref inputs "runc")
364 "/sbin/runc\"\n"))
365 (("DefaultRuntimeName = .*")
366 (string-append "DefaultRuntimeName = \""
367 (assoc-ref inputs "runc")
368 "/sbin/runc\"\n")))
369 (substitute* "daemon/config/config.go"
370 (("StockRuntimeName = .*")
371 (string-append "StockRuntimeName = \""
372 (assoc-ref inputs "runc")
373 "/sbin/runc\"\n"))
374 (("DefaultInitBinary = .*")
375 (string-append "DefaultInitBinary = \""
376 (assoc-ref inputs "tini")
377 "/bin/tini\"\n")))
378 (substitute* "daemon/config/config_common_unix_test.go"
379 (("expectedInitPath: \"docker-init\"")
380 (string-append "expectedInitPath: \""
381 (assoc-ref inputs "tini")
382 "/bin/tini\"")))
383 (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go"
384 (("var defaultCommandCandidates = .*")
385 (string-append "var defaultCommandCandidates = []string{\""
386 (assoc-ref inputs "runc") "/sbin/runc\"}")))
387 (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go"
388 (("var userlandProxyCommandName = .*")
389 (string-append "var userlandProxyCommandName = \""
390 (assoc-ref inputs "docker-proxy")
391 "/bin/proxy\"\n")))
392 (substitute* "pkg/archive/archive.go"
393 (("string\\{\"xz")
394 (string-append "string{\"" (assoc-ref inputs "xz") "/bin/xz")))
395 (let ((source-files (filter (lambda (name)
396 (not (string-contains name "test")))
397 (find-files "." "\\.go$"))))
398 (let-syntax ((substitute-LookPath*
399 (syntax-rules ()
400 ((_ (source-text package relative-path) ...)
401 (substitute* source-files
402 (((string-append "\\<exec\\.LookPath\\(\""
403 source-text
404 "\")"))
405 (string-append "\""
406 (assoc-ref inputs package)
407 "/" relative-path
408 "\", error(nil)")) ...))))
409 (substitute-Command*
410 (syntax-rules ()
411 ((_ (source-text package relative-path) ...)
412 (substitute* source-files
413 (((string-append "\\<(re)?exec\\.Command\\(\""
414 source-text
415 "\"") _ re?)
416 (string-append (if re? re? "")
417 "exec.Command(\""
418 (assoc-ref inputs package)
419 "/" relative-path
420 "\"")) ...)))))
421 (substitute-LookPath*
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 #t))
496 (replace 'configure
497 (lambda _
498 (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version))
499 ;; Automatically use bundled dependencies.
500 ;; TODO: Unbundle - see file "vendor.conf".
501 (setenv "AUTO_GOPATH" "1")
502 ;; Respectively, strip the symbol table and debug
503 ;; information, and the DWARF symbol table.
504 (setenv "LDFLAGS" "-s -w")
505 ;; Make build faster
506 (setenv "GOCACHE" "/tmp")
507 #t))
508 (add-before 'build 'setup-go-environment
509 (assoc-ref go:%standard-phases 'setup-go-environment))
510 (replace 'build
511 (lambda _
512 ;; Our LD doesn't like the statically linked relocatable things
513 ;; that go produces, so install the dynamic version of
514 ;; dockerd instead.
515 (invoke "hack/make.sh" "dynbinary")))
516 (replace 'check
517 (lambda _
518 ;; The build process generated a file because the environment
519 ;; variable "AUTO_GOPATH" was set. Use it.
520 (setenv "GOPATH" (string-append (getcwd) "/.gopath"))
521 ;; ".gopath/src/github.com/docker/docker" is a link to the current
522 ;; directory and chdir would canonicalize to that.
523 ;; But go needs to have the uncanonicalized directory name, so
524 ;; store that.
525 (setenv "PWD" (string-append (getcwd)
526 "/.gopath/src/github.com/docker/docker"))
527 (with-directory-excursion ".gopath/src/github.com/docker/docker"
528 (invoke "hack/test/unit"))
529 (setenv "PWD" #f)
530 #t))
531 (replace 'install
532 (lambda* (#:key outputs #:allow-other-keys)
533 (let* ((out (assoc-ref outputs "out"))
534 (out-bin (string-append out "/bin")))
535 (install-file "bundles/dynbinary-daemon/dockerd" out-bin)
536 (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)
537 #t))))))
538 (inputs
539 `(("btrfs-progs" ,btrfs-progs)
540 ("containerd" ,containerd) ; for containerd-shim
541 ("coreutils" ,coreutils)
542 ("dbus" ,dbus)
543 ("docker-proxy" ,docker-libnetwork-cmd-proxy)
544 ("e2fsprogs" ,e2fsprogs)
545 ("git" ,git)
546 ("iproute2" ,iproute)
547 ("iptables" ,iptables)
548 ("kmod" ,kmod)
549 ("libseccomp" ,libseccomp)
550 ("pigz" ,pigz)
551 ("procps" ,procps)
552 ("runc" ,runc)
553 ("util-linux" ,util-linux)
554 ("lvm2" ,lvm2)
555 ("tini" ,tini)
556 ("xfsprogs" ,xfsprogs)
557 ("xz" ,xz)))
558 (native-inputs
559 `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc)
560 ("go" ,go)
561 ("pkg-config" ,pkg-config)))
562 (synopsis "Docker container component library, and daemon")
563 (description "This package provides a framework to assemble specialized
564 container systems. It includes components for orchestration, image
565 management, secret management, configuration management, networking,
566 provisioning etc.")
567 (home-page "https://mobyproject.org/")
568 (license license:asl2.0)))
569
570 (define-public docker-cli
571 (package
572 (name "docker-cli")
573 (version %docker-version)
574 (source
575 (origin
576 (method git-fetch)
577 (uri (git-reference
578 (url "https://github.com/docker/cli.git")
579 (commit (string-append "v" version))))
580 (file-name (git-file-name name version))
581 (sha256
582 (base32 "0mxxjzkwdny8p2dmyjich7x1gn7hdlfppzjy2skk2k5bwv7nxpmi"))))
583 (build-system go-build-system)
584 (arguments
585 `(#:import-path "github.com/docker/cli"
586 ;; TODO: Tests require a running Docker daemon.
587 #:tests? #f
588 #:phases
589 (modify-phases %standard-phases
590 (add-before 'build 'setup-environment-2
591 (lambda _
592 ;; Respectively, strip the symbol table and debug
593 ;; information, and the DWARF symbol table.
594 (setenv "LDFLAGS" "-s -w")
595
596 ;; Make sure "docker -v" prints a usable version string.
597 (setenv "VERSION" ,%docker-version)
598
599 ;; Make build reproducible.
600 (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00")
601 (symlink "src/github.com/docker/cli/scripts" "./scripts")
602 (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile")
603 #t))
604 (replace 'build
605 (lambda _
606 (invoke "./scripts/build/dynbinary")))
607 (replace 'check
608 (lambda* (#:key make-flags tests? #:allow-other-keys)
609 (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH")))
610 (if tests?
611 ;; Use the newly-built docker client for the tests.
612 (with-directory-excursion "src/github.com/docker/cli"
613 ;; TODO: Run test-e2e as well?
614 (apply invoke "make" "-f" "docker.Makefile" "test-unit"
615 (or make-flags '())))
616 #t)))
617 (replace 'install
618 (lambda* (#:key outputs #:allow-other-keys)
619 (let* ((out (assoc-ref outputs "out"))
620 (out-bin (string-append out "/bin"))
621 (etc (string-append out "/etc")))
622 (with-directory-excursion "src/github.com/docker/cli/contrib/completion"
623 (install-file "bash/docker"
624 (string-append etc "/bash_completion.d"))
625 (install-file "fish/docker.fish"
626 (string-append etc "/fish/completions"))
627 (install-file "zsh/_docker"
628 (string-append etc "/zsh/site-functions")))
629 (chdir "build")
630 (install-file "docker" out-bin)
631 #t))))))
632 (native-inputs
633 `(("go" ,go)
634 ("libltdl" ,libltdl)
635 ("pkg-config" ,pkg-config)))
636 (synopsis "Command line interface to Docker")
637 (description "This package provides a command line interface to Docker.")
638 (home-page "https://www.docker.com/")
639 (license license:asl2.0)))
640
641 (define-public cqfd
642 (package
643 (name "cqfd")
644 (version "5.1.0")
645 (source (origin
646 (method git-fetch)
647 (uri (git-reference
648 (url "https://github.com/savoirfairelinux/cqfd.git")
649 (commit (string-append "v" version))))
650 (file-name (git-file-name name version))
651 (sha256
652 (base32
653 "1xhydz01f2rrnw7rmnaxh3f3q1ariq7j2ig0i0w1p3wn10l3q0nv"))))
654 (build-system gnu-build-system)
655 (arguments
656 ;; The test suite requires a docker daemon and connectivity.
657 `(#:tests? #f
658 #:phases
659 (modify-phases %standard-phases
660 (delete 'configure)
661 (delete 'build)
662 (replace 'install
663 (lambda* (#:key outputs #:allow-other-keys)
664 (let ((out (assoc-ref outputs "out")))
665 ;; Fix the directory of the bash completion.
666 (substitute* "Makefile"
667 (("completionsdir=.*$")
668 (string-append "completionsdir=" out
669 "/etc/bash_completion.d; \\\n")))
670 (invoke "make" "install"
671 (string-append "PREFIX=" out))))))))
672 (home-page "https://github.com/savoirfairelinux/cqfd")
673 (synopsis "Convenience wrapper for Docker")
674 (description "cqfd is a Bash script that provides a quick and convenient
675 way to run commands in the current directory, but within a Docker container
676 defined in a per-project configuration file.")
677 (license license:gpl3+)))
678
679 (define-public tini
680 (package
681 (name "tini")
682 (version "0.18.0")
683 (source (origin
684 (method git-fetch)
685 (uri (git-reference
686 (url "https://github.com/krallin/tini.git")
687 (commit (string-append "v" version))))
688 (file-name (git-file-name name version))
689 (sha256
690 (base32
691 "1h20i3wwlbd8x4jr2gz68hgklh0lb0jj7y5xk1wvr8y58fip1rdn"))))
692 (build-system cmake-build-system)
693 (arguments
694 `(#:tests? #f ;tests require a Docker daemon
695 #:phases (modify-phases %standard-phases
696 (add-after 'unpack 'disable-static-build
697 ;; Disable the static build as it fails to install, with
698 ;; the error: "No valid ELF RPATH or RUNPATH entry exists
699 ;; in the file".
700 (lambda _
701 (substitute* "CMakeLists.txt"
702 ((".*tini-static.*") ""))
703 #t)))))
704 (home-page "https://github.com/krallin/tini")
705 (synopsis "Tiny but valid init for containers")
706 (description "Tini is an init program specifically designed for use with
707 containers. It manages a single child process and ensures that any zombie
708 processes produced from it are reaped and that signals are properly forwarded.
709 Tini is integrated with Docker.")
710 (license license:expat)))