services: docker: Add new fields to support proxy.
[jackhill/guix/guix.git] / gnu / packages / docker.scm
CommitLineData
d020bfc2
DT
1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016 David Thompson <davet@gnu.org>
42531fd3 3;;; Copyright © 2018 Efraim Flashner <efraim@flashner.co.il>
26b7d23a 4;;; Copyright © 2019 Tobias Geerinckx-Rice <me@tobias.gr>
975a953b 5;;; Copyright © 2019 Maxim Cournoyer <maxim.cournoyer@gmail.com>
d020bfc2
DT
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)
f87ea24a 28 #:use-module (guix build-system gnu)
4e5b8f72 29 #:use-module (guix build-system go)
d020bfc2
DT
30 #:use-module (guix build-system python)
31 #:use-module (guix utils)
e9b31645 32 #:use-module (gnu packages autotools)
58adcaa1 33 #:use-module (gnu packages base)
42531fd3 34 #:use-module (gnu packages check)
f87ea24a 35 #:use-module (gnu packages compression)
6b6a25d4 36 #:use-module (gnu packages glib)
4e5b8f72
DM
37 #:use-module (gnu packages golang)
38 #:use-module (gnu packages linux)
0b94911a 39 #:use-module (gnu packages networking)
4e5b8f72 40 #:use-module (gnu packages pkg-config)
1b2f753d 41 #:use-module (gnu packages python)
1f1e338a 42 #:use-module (gnu packages python-web)
44d10b1f 43 #:use-module (gnu packages python-xyz)
6b6a25d4 44 #:use-module (gnu packages version-control)
1f1e338a 45 #:use-module (gnu packages virtualization))
d020bfc2 46
0e84987f 47(define %docker-version "18.09.5")
f87ea24a 48
d020bfc2
DT
49(define-public python-docker-py
50 (package
51 (name "python-docker-py")
b24da117 52 (version "1.10.6")
d020bfc2
DT
53 (source
54 (origin
55 (method url-fetch)
56 (uri (pypi-uri "docker-py" version))
57 (sha256
58 (base32
b24da117 59 "05f49f6hnl7npmi7kigg0ibqk8s3fhzx1ivvz1kqvlv4ay3paajc"))))
d020bfc2
DT
60 (build-system python-build-system)
61 ;; TODO: Tests require a running Docker daemon.
62 (arguments '(#:tests? #f))
63 (inputs
64 `(("python-requests" ,python-requests)
d020bfc2
DT
65 ("python-six" ,python-six)
66 ("python-websocket-client" ,python-websocket-client)))
67 (home-page "https://github.com/docker/docker-py/")
68 (synopsis "Python client for Docker")
69 (description "Docker-Py is a Python client for the Docker container
70management tool.")
71 (license license:asl2.0)))
b42c9c81
DT
72
73(define-public python-dockerpty
74 (package
75 (name "python-dockerpty")
76 (version "0.3.4")
77 (source
78 (origin
79 (method url-fetch)
80 (uri (pypi-uri "dockerpty" version))
81 (sha256
82 (base32
83 "0za6rr349641wv76ww9l3zcic2xyxrirlxpnzl4296h897648455"))))
84 (build-system python-build-system)
85 (native-inputs
86 `(("python-six" ,python-six)))
87 (home-page "https://github.com/d11wtq/dockerpty")
88 (synopsis "Python library to use the pseudo-TTY of a Docker container")
89 (description "Docker PTY provides the functionality needed to operate the
90pseudo-terminal (PTY) allocated to a Docker container using the Python
91client.")
92 (license license:asl2.0)))
df1f1d69
DT
93
94(define-public docker-compose
95 (package
96 (name "docker-compose")
97 (version "1.5.2")
98 (source
99 (origin
100 (method url-fetch)
101 (uri (pypi-uri "docker-compose" version))
102 (sha256
103 (base32
104 "0ksg7hm2yvc977968dixxisrhcmvskzpcx3pz0v1kazrdqp7xakr"))))
105 (build-system python-build-system)
106 ;; TODO: Tests require running Docker daemon.
107 (arguments '(#:tests? #f))
108 (inputs
109 `(("python-docker-py" ,python-docker-py)
110 ("python-dockerpty" ,python-dockerpty)
111 ("python-docopt" ,python-docopt)
df1f1d69
DT
112 ("python-jsonschema" ,python-jsonschema)
113 ("python-pyyaml" ,python-pyyaml)
114 ("python-requests" ,python-requests-2.7)
df1f1d69
DT
115 ("python-six" ,python-six)
116 ("python-texttable" ,python-texttable)
117 ("python-websocket-client" ,python-websocket-client)))
118 (home-page "https://www.docker.com/")
119 (synopsis "Multi-container orchestration for Docker")
120 (description "Docker Compose is a tool for defining and running
121multi-container Docker applications. A Compose file is used to configure an
122application’s services. Then, using a single command, the containers are
123created and all the services are started as specified in the configuration.")
124 (license license:asl2.0)))
42531fd3
EF
125
126(define-public python-docker-pycreds
127 (package
128 (name "python-docker-pycreds")
129 (version "0.3.0")
130 (source
131 (origin
132 (method url-fetch)
133 (uri (pypi-uri "docker-pycreds" version))
134 (sha256
135 (base32
136 "1zxvam1q22qb0jf48553nnncnfrcp88ag4xa0qmq6vr0imn9a3lb"))))
137 (build-system python-build-system)
138 (arguments
139 `(#:phases
140 (modify-phases %standard-phases
141 (add-after 'unpack 'fix-versioning
142 (lambda _
143 (substitute* "test-requirements.txt"
144 (("3.0.2") ,(package-version python-pytest))
145 (("2.3.1") ,(package-version python-pytest-cov))
146 (("2.4.1") ,(package-version python-flake8)))
147 #t)))))
148 (native-inputs
149 `(("python-flake8" ,python-flake8)
150 ("python-pytest" ,python-pytest)
151 ("python-pytest-cov" ,python-pytest-cov)))
152 (propagated-inputs
153 `(("python-six" ,python-six)))
154 (home-page "https://github.com/shin-/dockerpy-creds")
155 (synopsis
156 "Python bindings for the Docker credentials store API")
157 (description
158 "Docker-Pycreds contains the Python bindings for the docker credentials
159store API. It allows programmers to interact with a Docker registry using
160Python without keeping their credentials in a Docker configuration file.")
161 (license license:asl2.0)))
4e5b8f72
DM
162
163(define-public containerd
164 (package
165 (name "containerd")
a333cbf1 166 (version "1.2.5")
4e5b8f72
DM
167 (source
168 (origin
169 (method git-fetch)
170 (uri (git-reference
171 (url "https://github.com/containerd/containerd.git")
172 (commit (string-append "v" version))))
173 (file-name (git-file-name name version))
174 (sha256
a333cbf1 175 (base32 "0npbzixf3c0jvzm159vygvkydrr8h36c9sq50yv0mdinrys2bvg0"))))
4e5b8f72
DM
176 (build-system go-build-system)
177 (arguments
178 `(#:import-path "github.com/containerd/containerd"
4e5b8f72
DM
179 #:phases
180 (modify-phases %standard-phases
181 (add-before 'build 'chdir
182 (lambda _
183 (chdir "src/github.com/containerd/containerd")
184 #t))
185 (add-after 'chdir 'patch-paths
186 (lambda* (#:key inputs outputs #:allow-other-keys)
187 ;; TODO: Patch "socat", "unpigz".
188 (substitute* "./runtime/v1/linux/runtime.go"
189 (("defaultRuntime[ \t]*=.*")
190 (string-append "defaultRuntime = \""
191 (assoc-ref inputs "runc")
192 "/sbin/runc\"\n"))
193 (("defaultShim[ \t]*=.*")
194 (string-append "defaultShim = \""
195 (assoc-ref outputs "out")
196 "/bin/containerd-shim\"\n")))
197 (substitute* "./vendor/github.com/containerd/go-runc/runc.go"
198 (("DefaultCommand[ \t]*=.*")
199 (string-append "DefaultCommand = \""
200 (assoc-ref inputs "runc")
201 "/sbin/runc\"\n")))
8b487bf8
DM
202 (substitute* "vendor/github.com/containerd/continuity/testutil/loopback/loopback_linux.go"
203 (("exec\\.Command\\(\"losetup\"") ; )
204 (string-append "exec.Command(\""
205 (assoc-ref inputs "util-linux")
206 "/sbin/losetup\""))) ;)
4e5b8f72
DM
207 #t))
208 (replace 'build
209 (lambda* (#:key (make-flags '()) #:allow-other-keys)
210 (apply invoke "make" make-flags)))
211 (replace 'install
212 (lambda* (#:key outputs (make-flags '()) #:allow-other-keys)
213 (let* ((out (assoc-ref outputs "out")))
214 (apply invoke "make" (string-append "DESTDIR=" out) "install"
215 make-flags)))))))
216 (inputs
217 `(("btrfs-progs" ,btrfs-progs)
218 ("libseccomp" ,libseccomp)
8b487bf8
DM
219 ("runc" ,runc)
220 ("util-linux" ,util-linux)))
4e5b8f72
DM
221 (native-inputs
222 `(("go" ,go)
223 ("pkg-config" ,pkg-config)))
40c7476a 224 (synopsis "Docker container runtime")
4e5b8f72
DM
225 (description "This package provides the container daemon for Docker.
226It includes image transfer and storage, container execution and supervision,
227network attachments.")
228 (home-page "http://containerd.io/")
229 (license license:asl2.0)))
f87ea24a 230
9c0244ab
MC
231;;; Private package that shouldn't be used directly; its purposes is to be
232;;; used as a template for the various packages it contains. It doesn't build
233;;; anyway, as it needs many dependencies that aren't being satisfied.
234(define docker-libnetwork
235 ;; There are no recent release for libnetwork, so choose the last commit of
236 ;; the branch that Docker uses, as can be seen in the Docker source file
237 ;; 'hack/dockerfile/install/proxy.installer'.
238 (let ((commit "4725f2163fb214a6312f3beae5991f838ec36326")
239 (version "18.09")
240 (revision "1"))
241 (package
242 (name "docker-libnetwork")
243 (version (git-version version "1" commit))
244 (source (origin
245 (method git-fetch)
246 (uri (git-reference
247 (url "https://github.com/docker/libnetwork.git")
248 (commit commit)))
249 (file-name (git-file-name name version))
250 (sha256
251 (base32
252 "1zpnxki8qfzha6ljahpwd3vkzmjhsvkmf73w6crm4ilxxw5vnpfb"))
253 ;; Delete bundled ("vendored") free software source code.
254 (modules '((guix build utils)))
255 (snippet '(begin
256 (delete-file-recursively "vendor")
257 #t))))
258 (build-system go-build-system)
259 (arguments
260 `(#:import-path "github.com/docker/libnetwork/"))
261 (home-page "https://github.com/docker/libnetwork/")
262 (synopsis "Networking for containers")
263 (description "Libnetwork provides a native Go implementation for
264connecting containers. The goal of @code{libnetwork} is to deliver a robust
265container network model that provides a consistent programming interface and
266the required network abstractions for applications.")
267 (license license:asl2.0))))
268
0b94911a
MC
269(define-public docker-libnetwork-cmd-proxy
270 (package
271 (inherit docker-libnetwork)
272 (name "docker-libnetwork-cmd-proxy")
273 (arguments
274 `(#:import-path "github.com/docker/libnetwork/cmd/proxy"
275 #:unpack-path "github.com/docker/libnetwork"
276 #:install-source? #f))
277 (native-inputs
278 `(("go-sctp" ,go-sctp)
279 ;; For tests.
280 ("logrus" ,go-github-com-sirupsen-logrus)
281 ("go-netlink" ,go-netlink)
282 ("go-netns" ,go-netns)
283 ("go-golang-org-x-crypto-ssh-terminal"
284 ,go-golang-org-x-crypto-ssh-terminal)
285 ("go-golang-org-x-sys-unix" ,go-golang-org-x-sys-unix)))
286 (synopsis "Docker user-space proxy")
287 (description "A proxy running in the user space. It is used by the
288built-in registry server of Docker.")
289 (license license:asl2.0)))
290
516f6f55
DM
291;; TODO: Patch out modprobes for ip_vs, nf_conntrack,
292;; brige, nf_conntrack_netlink, aufs.
f87ea24a
DM
293(define-public docker
294 (package
295 (name "docker")
296 (version %docker-version)
297 (source
298 (origin
299 (method git-fetch)
300 (uri (git-reference
301 (url "https://github.com/docker/engine.git")
302 (commit (string-append "v" version))))
303 (file-name (git-file-name name version))
304 (sha256
0e84987f 305 (base32 "0cirpd9l2qazp2jyanwzvrkx2m98nksjdvn43ff38p89w6133ipb"))
f87ea24a
DM
306 (patches
307 (search-patches "docker-engine-test-noinstall.patch"
516f6f55
DM
308 "docker-fix-tests.patch"
309 "docker-use-fewer-modprobes.patch"))))
f87ea24a
DM
310 (build-system gnu-build-system)
311 (arguments
312 `(#:modules
313 ((guix build gnu-build-system)
314 ((guix build go-build-system) #:prefix go:)
e3900a4d 315 (guix build union)
f87ea24a
DM
316 (guix build utils))
317 #:imported-modules
318 (,@%gnu-build-system-modules
e3900a4d 319 (guix build union)
f87ea24a
DM
320 (guix build go-build-system))
321 #:phases
322 (modify-phases %standard-phases
323 (add-after 'unpack 'patch-paths
324 (lambda* (#:key inputs #:allow-other-keys)
325 (substitute* "builder/builder-next/executor_unix.go"
326 (("CommandCandidates:.*runc.*")
327 (string-append "CommandCandidates: []string{\""
328 (assoc-ref inputs "runc")
329 "/sbin/runc\"},\n")))
330 (substitute* "vendor/github.com/containerd/go-runc/runc.go"
331 (("DefaultCommand = .*")
332 (string-append "DefaultCommand = \""
333 (assoc-ref inputs "runc")
334 "/sbin/runc\"\n")))
335 (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go"
336 (("defaultRuntime[ \t]*=.*")
337 (string-append "defaultRuntime = \""
338 (assoc-ref inputs "runc")
339 "/sbin/runc\"\n"))
340 (("defaultShim[ \t]*=.*")
341 (string-append "defaultShim = \""
342 (assoc-ref inputs "containerd")
343 "/bin/containerd-shim\"\n")))
344 (substitute* "daemon/daemon_unix.go"
345 (("DefaultShimBinary = .*")
346 (string-append "DefaultShimBinary = \""
347 (assoc-ref inputs "containerd")
348 "/bin/containerd-shim\"\n"))
349 (("DefaultRuntimeBinary = .*")
350 (string-append "DefaultRuntimeBinary = \""
351 (assoc-ref inputs "runc")
352 "/sbin/runc\"\n"))
353 (("DefaultRuntimeName = .*")
354 (string-append "DefaultRuntimeName = \""
355 (assoc-ref inputs "runc")
356 "/sbin/runc\"\n")))
357 (substitute* "daemon/config/config.go"
358 (("StockRuntimeName = .*")
359 (string-append "StockRuntimeName = \""
360 (assoc-ref inputs "runc")
361 "/sbin/runc\"\n")))
362 (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go"
363 (("var defaultCommandCandidates = .*")
364 (string-append "var defaultCommandCandidates = []string{\""
365 (assoc-ref inputs "runc") "/sbin/runc\"}")))
366 (let ((source-files (filter (lambda (name)
367 (not (string-contains name "test")))
368 (find-files "." "\\.go$"))))
369 (let-syntax ((substitute-LookPath
370 (lambda (x)
371 (syntax-case x ()
372 ((substitute-LookPath source-text package
373 relative-path)
374 #`(substitute* source-files
375 ((#,(string-append "exec\\.LookPath\\(\""
376 (syntax->datum
377 #'source-text)
378 "\")"))
379 (string-append "\""
380 (assoc-ref inputs package)
381 relative-path
58adcaa1
DM
382 "\", error(nil)")))))))
383 (substitute-Command
384 (lambda (x)
385 (syntax-case x ()
386 ((substitute-LookPath source-text package
387 relative-path)
388 #`(substitute* source-files
389 ((#,(string-append "exec\\.Command\\(\""
390 (syntax->datum
391 #'source-text)
392 "\"")) ; )
393 (string-append "exec.Command(\""
394 (assoc-ref inputs package)
395 relative-path
396 "\"")))))))) ; )
f87ea24a
DM
397 (substitute-LookPath "ps" "procps" "/bin/ps")
398 (substitute-LookPath "mkfs.xfs" "xfsprogs" "/bin/mkfs.xfs")
399 (substitute-LookPath "lvmdiskscan" "lvm2" "/sbin/lvmdiskscan")
400 (substitute-LookPath "pvdisplay" "lvm2" "/sbin/pvdisplay")
401 (substitute-LookPath "blkid" "util-linux" "/sbin/blkid")
402 (substitute-LookPath "unpigz" "pigz" "/bin/unpigz")
403 (substitute-LookPath "iptables" "iptables" "/sbin/iptables")
ea7cddaa 404 (substitute-LookPath "iptables-legacy" "iptables" "/sbin/iptables")
58adcaa1
DM
405 (substitute-LookPath "ip" "iproute2" "/sbin/ip")
406 (substitute-Command "modprobe" "kmod" "/bin/modprobe")
407 (substitute-Command "pvcreate" "lvm2" "/sbin/pvcreate")
408 (substitute-Command "vgcreate" "lvm2" "/sbin/vgcreate")
409 (substitute-Command "lvcreate" "lvm2" "/sbin/lvcreate")
410 (substitute-Command "lvconvert" "lvm2" "/sbin/lvconvert")
411 (substitute-Command "lvchange" "lvm2" "/sbin/lvchange")
412 (substitute-Command "mkfs.xfs" "xfsprogs" "/sbin/mkfs.xfs")
413 (substitute-Command "xfs_growfs" "xfsprogs" "/sbin/xfs_growfs")
414 (substitute-Command "mkfs.ext4" "e2fsprogs" "/sbin/mkfs.ext4")
415 (substitute-Command "tune2fs" "e2fsprogs" "/sbin/tune2fs")
416 (substitute-Command "blkid" "util-linux" "/sbin/blkid")
417 (substitute-Command "resize2fs" "e2fsprogs" "/sbin/resize2fs")
418; docker-mountfrom ??
419; docker
6b6a25d4
DM
420; docker-untar ??
421; docker-applyLayer ??
58adcaa1 422; /usr/bin/uname
58adcaa1
DM
423; grep
424; apparmor_parser
425 (substitute-Command "ps" "procps" "/bin/ps")
426 (substitute-Command "losetup" "util-linux" "/sbin/losetup")
6b6a25d4
DM
427 (substitute-Command "uname" "coreutils" "/bin/uname")
428 (substitute-Command "dbus-launch" "dbus" "/bin/dbus-launch")
429 (substitute-Command "git" "git" "/bin/git"))
65a7e35c
DM
430 ;; Make compilation fail when, in future versions, Docker
431 ;; invokes other programs we don't know about and thus don't
432 ;; substitute.
433 (substitute* source-files
ffcd2827
DM
434 ;; Search for Java in PATH.
435 (("\\<exec\\.Command\\(\"java\"") ; )
436 "xxec.Command(\"java\"") ; )
437 ;; Search for AUFS in PATH (mainline Linux doesn't support it).
438 (("\\<exec\\.Command\\(\"auplink\"") ; )
439 "xxec.Command(\"auplink\"") ; )
440 ;; Fail on other unsubstituted commands.
441 (("\\<exec\\.Command\\(\"([a-zA-Z0-9][a-zA-Z0-9_-]*)\""
442 _ executable) ; )
443 (string-append "exec.Guix_doesnt_want_Command(\""
444 executable "\"")) ;)
445 (("\\<xxec\\.Command")
446 "exec.Command")
447 ;; Search for ZFS in PATH.
448 (("\\<LookPath\\(\"zfs\"\\)") "LooxPath(\"zfs\")")
449 ;; Fail on other unsubstituted LookPaths.
450 (("\\<LookPath\\(\"") "Guix_doesnt_want_LookPath\\(\"") ; ))
451 (("\\<LooxPath") "LookPath")))
f87ea24a
DM
452 #t))
453 (add-after 'patch-paths 'delete-failing-tests
454 (lambda _
455 ;; Needs internet access.
456 (delete-file "builder/remotecontext/git/gitutils_test.go")
457 ;; Permission denied.
458 (delete-file "daemon/graphdriver/devmapper/devmapper_test.go")
459 ;; Operation not permitted (idtools.MkdirAllAndChown).
460 (delete-file "daemon/graphdriver/vfs/vfs_test.go")
461 ;; Timeouts after 5 min.
462 (delete-file "plugin/manager_linux_test.go")
8cd95860 463 ;; Operation not permitted.
74bf1b5d 464 (delete-file "daemon/graphdriver/btrfs/btrfs_test.go")
8cd95860
DM
465 (delete-file "daemon/graphdriver/overlay/overlay_test.go")
466 (delete-file "daemon/graphdriver/overlay2/overlay_test.go")
f87ea24a
DM
467 #t))
468 (replace 'configure
469 (lambda _
470 (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version))
471 ;; Automatically use bundled dependencies.
472 ;; TODO: Unbundle - see file "vendor.conf".
473 (setenv "AUTO_GOPATH" "1")
474 ;; Respectively, strip the symbol table and debug
475 ;; information, and the DWARF symbol table.
476 (setenv "LDFLAGS" "-s -w")
477 ;; Make build faster
478 (setenv "GOCACHE" "/tmp")
479 #t))
e3900a4d
LF
480 (add-before 'build 'setup-go-environment
481 (assoc-ref go:%standard-phases 'setup-go-environment))
f87ea24a
DM
482 (replace 'build
483 (lambda _
484 ;; Our LD doesn't like the statically linked relocatable things
485 ;; that go produces, so install the dynamic version of
486 ;; dockerd instead.
487 (invoke "hack/make.sh" "dynbinary")))
488 (replace 'check
489 (lambda _
490 ;; The build process generated a file because the environment
491 ;; variable "AUTO_GOPATH" was set. Use it.
492 (setenv "GOPATH" (string-append (getcwd) "/.gopath"))
493 ;; ".gopath/src/github.com/docker/docker" is a link to the current
494 ;; directory and chdir would canonicalize to that.
495 ;; But go needs to have the uncanonicalized directory name, so
496 ;; store that.
497 (setenv "PWD" (string-append (getcwd)
498 "/.gopath/src/github.com/docker/docker"))
499 (with-directory-excursion ".gopath/src/github.com/docker/docker"
500 (invoke "hack/test/unit"))
501 (setenv "PWD" #f)
502 #t))
503 (replace 'install
504 (lambda* (#:key outputs #:allow-other-keys)
505 (let* ((out (assoc-ref outputs "out"))
506 (out-bin (string-append out "/bin")))
507 (install-file "bundles/dynbinary-daemon/dockerd" out-bin)
508 (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin)
509 #t))))))
510 (inputs
511 `(("btrfs-progs" ,btrfs-progs)
512 ("containerd" ,containerd) ; for containerd-shim
58adcaa1 513 ("coreutils" ,coreutils)
6b6a25d4 514 ("dbus" ,dbus)
58adcaa1 515 ("e2fsprogs" ,e2fsprogs)
6b6a25d4 516 ("git" ,git)
f87ea24a
DM
517 ("iproute2" ,iproute)
518 ("iptables" ,iptables)
58adcaa1 519 ("kmod" ,kmod)
f87ea24a
DM
520 ("libseccomp" ,libseccomp)
521 ("pigz" ,pigz)
522 ("procps" ,procps)
58adcaa1 523 ("runc" ,runc)
f87ea24a
DM
524 ("util-linux" ,util-linux)
525 ("lvm2" ,lvm2)
526 ("xfsprogs" ,xfsprogs)))
527 (native-inputs
528 `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc)
529 ("go" ,go)
530 ("pkg-config" ,pkg-config)))
531 (synopsis "Docker container component library, and daemon")
532 (description "This package provides a framework to assemble specialized
533container systems. It includes components for orchestration, image
534management, secret management, configuration management, networking,
535provisioning etc.")
536 (home-page "https://mobyproject.org/")
537 (license license:asl2.0)))
e9b31645
DM
538
539(define-public docker-cli
540 (package
541 (name "docker-cli")
542 (version %docker-version)
543 (source
544 (origin
545 (method git-fetch)
546 (uri (git-reference
547 (url "https://github.com/docker/cli.git")
548 (commit (string-append "v" version))))
549 (file-name (git-file-name name version))
550 (sha256
0e84987f 551 (base32 "0mxxjzkwdny8p2dmyjich7x1gn7hdlfppzjy2skk2k5bwv7nxpmi"))))
e9b31645
DM
552 (build-system go-build-system)
553 (arguments
554 `(#:import-path "github.com/docker/cli"
555 ;; TODO: Tests require a running Docker daemon.
556 #:tests? #f
557 #:phases
558 (modify-phases %standard-phases
559 (add-before 'build 'setup-environment-2
560 (lambda _
561 ;; Respectively, strip the symbol table and debug
562 ;; information, and the DWARF symbol table.
563 (setenv "LDFLAGS" "-s -w")
564
565 ;; Make build reproducible.
566 (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00")
567 (symlink "src/github.com/docker/cli/scripts" "./scripts")
568 (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile")
569 #t))
570 (replace 'build
571 (lambda _
572 (invoke "./scripts/build/dynbinary")))
573 (replace 'check
574 (lambda* (#:key make-flags tests? #:allow-other-keys)
575 (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH")))
576 (if tests?
577 ;; Use the newly-built docker client for the tests.
578 (with-directory-excursion "src/github.com/docker/cli"
579 ;; TODO: Run test-e2e as well?
580 (apply invoke "make" "-f" "docker.Makefile" "test-unit"
581 (or make-flags '())))
582 #t)))
583 (replace 'install
584 (lambda* (#:key outputs #:allow-other-keys)
585 (let* ((out (assoc-ref outputs "out"))
586 (out-bin (string-append out "/bin")))
587 (chdir "build")
e9b31645
DM
588 (install-file "docker" out-bin)
589 #t))))))
590 (native-inputs
591 `(("go" ,go)
592 ("libltdl" ,libltdl)
593 ("pkg-config" ,pkg-config)))
594 (synopsis "Command line interface to Docker")
595 (description "This package provides a command line interface to Docker.")
17d25019 596 (home-page "https://www.docker.com/")
e9b31645 597 (license license:asl2.0)))
975a953b
MC
598
599(define-public cqfd
600 (package
601 (name "cqfd")
602 (version "5.0.1")
603 (source (origin
604 (method git-fetch)
605 (uri (git-reference
606 (url "https://github.com/savoirfairelinux/cqfd.git")
607 (commit (string-append "v" version))))
608 (file-name (git-file-name name version))
609 (sha256
610 (base32
611 "1z4v16lbpbwd5ykawizdclpryp2k006lbk2mv427a4b3nvcd9wik"))))
612 (build-system gnu-build-system)
613 (arguments
614 ;; The test suite requires a docker daemon and connectivity.
615 `(#:tests? #f
616 #:phases
617 (modify-phases %standard-phases
618 (delete 'configure)
619 (delete 'build)
620 (replace 'install
621 (lambda* (#:key outputs #:allow-other-keys)
622 (let ((out (assoc-ref outputs "out")))
623 ;; Fix the directory of the bash completion.
624 (substitute* "Makefile"
625 (("completionsdir=.*$")
626 (string-append "completionsdir=" out
627 "/etc/bash_completion.d; \\\n")))
628 (invoke "make" "install"
629 (string-append "PREFIX=" out))))))))
630 (home-page "https://github.com/savoirfairelinux/cqfd")
631 (synopsis "Convenience wrapper for Docker")
632 (description "cqfd is a Bash script that provides a quick and convenient
633way to run commands in the ecurrent directory, but within a Docker container
634defined in a per-project configuration file.")
635 (license license:gpl3+)))