Commit | Line | Data |
---|---|---|
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 | |
70 | management 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 | |
90 | pseudo-terminal (PTY) allocated to a Docker container using the Python | |
91 | client.") | |
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 | |
121 | multi-container Docker applications. A Compose file is used to configure an | |
122 | application’s services. Then, using a single command, the containers are | |
123 | created 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 | |
159 | store API. It allows programmers to interact with a Docker registry using | |
160 | Python 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. |
226 | It includes image transfer and storage, container execution and supervision, | |
227 | network 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 | |
264 | connecting containers. The goal of @code{libnetwork} is to deliver a robust | |
265 | container network model that provides a consistent programming interface and | |
266 | the 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 | |
288 | built-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 | |
c6279326 MC |
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 | |
305 | (base32 "0cirpd9l2qazp2jyanwzvrkx2m98nksjdvn43ff38p89w6133ipb")) | |
306 | (patches | |
307 | (search-patches "docker-engine-test-noinstall.patch" | |
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" | |
c6279326 MC |
326 | (("CommandCandidates:.*runc.*") |
327 | (string-append "CommandCandidates: []string{\"" | |
328 | (assoc-ref inputs "runc") | |
329 | "/sbin/runc\"},\n"))) | |
f87ea24a | 330 | (substitute* "vendor/github.com/containerd/go-runc/runc.go" |
c6279326 MC |
331 | (("DefaultCommand = .*") |
332 | (string-append "DefaultCommand = \"" | |
333 | (assoc-ref inputs "runc") | |
334 | "/sbin/runc\"\n"))) | |
f87ea24a | 335 | (substitute* "vendor/github.com/containerd/containerd/runtime/v1/linux/runtime.go" |
c6279326 MC |
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"))) | |
f87ea24a | 344 | (substitute* "daemon/daemon_unix.go" |
c6279326 MC |
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"))) | |
f87ea24a | 357 | (substitute* "daemon/config/config.go" |
c6279326 MC |
358 | (("StockRuntimeName = .*") |
359 | (string-append "StockRuntimeName = \"" | |
360 | (assoc-ref inputs "runc") | |
361 | "/sbin/runc\"\n"))) | |
f87ea24a | 362 | (substitute* "vendor/github.com/moby/buildkit/executor/runcexecutor/executor.go" |
c6279326 MC |
363 | (("var defaultCommandCandidates = .*") |
364 | (string-append "var defaultCommandCandidates = []string{\"" | |
365 | (assoc-ref inputs "runc") "/sbin/runc\"}"))) | |
80fec17f MC |
366 | (substitute* "vendor/github.com/docker/libnetwork/portmapper/proxy.go" |
367 | (("var userlandProxyCommandName = .*") | |
368 | (string-append "var userlandProxyCommandName = \"" | |
369 | (assoc-ref inputs "docker-proxy") | |
370 | "/bin/proxy\"\n"))) | |
f87ea24a | 371 | (let ((source-files (filter (lambda (name) |
c6279326 MC |
372 | (not (string-contains name "test"))) |
373 | (find-files "." "\\.go$")))) | |
a01d54f3 MC |
374 | (let-syntax ((substitute-LookPath* |
375 | (syntax-rules () | |
376 | ((_ (source-text package relative-path) ...) | |
377 | (substitute* source-files | |
378 | (((string-append "\\<exec\\.LookPath\\(\"" | |
379 | source-text | |
380 | "\")")) | |
381 | (string-append "\"" | |
382 | (assoc-ref inputs package) | |
383 | "/" relative-path | |
384 | "\", error(nil)")) ...)))) | |
385 | (substitute-Command* | |
386 | (syntax-rules () | |
387 | ((_ (source-text package relative-path) ...) | |
388 | (substitute* source-files | |
389 | (((string-append "\\<(re)?exec\\.Command\\(\"" | |
390 | source-text | |
391 | "\"") _ re?) | |
392 | (string-append (if re? re? "") | |
393 | "exec.Command(\"" | |
394 | (assoc-ref inputs package) | |
395 | "/" relative-path | |
396 | "\"")) ...))))) | |
397 | (substitute-LookPath* | |
398 | ("ps" "procps" "bin/ps") | |
399 | ("mkfs.xfs" "xfsprogs" "bin/mkfs.xfs") | |
400 | ("lvmdiskscan" "lvm2" "sbin/lvmdiskscan") | |
401 | ("pvdisplay" "lvm2" "sbin/pvdisplay") | |
402 | ("blkid" "util-linux" "sbin/blkid") | |
403 | ("unpigz" "pigz" "bin/unpigz") | |
404 | ("iptables" "iptables" "sbin/iptables") | |
405 | ("iptables-legacy" "iptables" "sbin/iptables") | |
406 | ("ip" "iproute2" "sbin/ip")) | |
407 | ||
408 | (substitute-Command* | |
409 | ("modprobe" "kmod" "bin/modprobe") | |
410 | ("pvcreate" "lvm2" "sbin/pvcreate") | |
411 | ("vgcreate" "lvm2" "sbin/vgcreate") | |
412 | ("lvcreate" "lvm2" "sbin/lvcreate") | |
413 | ("lvconvert" "lvm2" "sbin/lvconvert") | |
414 | ("lvchange" "lvm2" "sbin/lvchange") | |
415 | ("mkfs.xfs" "xfsprogs" "sbin/mkfs.xfs") | |
416 | ("xfs_growfs" "xfsprogs" "sbin/xfs_growfs") | |
417 | ("mkfs.ext4" "e2fsprogs" "sbin/mkfs.ext4") | |
418 | ("tune2fs" "e2fsprogs" "sbin/tune2fs") | |
419 | ("blkid" "util-linux" "sbin/blkid") | |
420 | ("resize2fs" "e2fsprogs" "sbin/resize2fs") | |
421 | ("ps" "procps" "bin/ps") | |
422 | ("losetup" "util-linux" "sbin/losetup") | |
423 | ("uname" "coreutils" "bin/uname") | |
424 | ("dbus-launch" "dbus" "bin/dbus-launch") | |
425 | ("git" "git" "bin/git"))) | |
426 | ;; docker-mountfrom ?? | |
427 | ;; docker | |
428 | ;; docker-untar ?? | |
429 | ;; docker-applyLayer ?? | |
430 | ;; /usr/bin/uname | |
431 | ;; grep | |
432 | ;; apparmor_parser | |
433 | ||
65a7e35c DM |
434 | ;; Make compilation fail when, in future versions, Docker |
435 | ;; invokes other programs we don't know about and thus don't | |
436 | ;; substitute. | |
437 | (substitute* source-files | |
c6279326 | 438 | ;; Search for Java in PATH. |
1b14e1bc MC |
439 | (("\\<exec\\.Command\\(\"java\"") |
440 | "xxec.Command(\"java\"") | |
c6279326 | 441 | ;; Search for AUFS in PATH (mainline Linux doesn't support it). |
1b14e1bc MC |
442 | (("\\<exec\\.Command\\(\"auplink\"") |
443 | "xxec.Command(\"auplink\"") | |
c6279326 MC |
444 | ;; Fail on other unsubstituted commands. |
445 | (("\\<exec\\.Command\\(\"([a-zA-Z0-9][a-zA-Z0-9_-]*)\"" | |
1b14e1bc | 446 | _ executable) |
c6279326 | 447 | (string-append "exec.Guix_doesnt_want_Command(\"" |
1b14e1bc | 448 | executable "\"")) |
c6279326 MC |
449 | (("\\<xxec\\.Command") |
450 | "exec.Command") | |
451 | ;; Search for ZFS in PATH. | |
452 | (("\\<LookPath\\(\"zfs\"\\)") "LooxPath(\"zfs\")") | |
453 | ;; Fail on other unsubstituted LookPaths. | |
1b14e1bc | 454 | (("\\<LookPath\\(\"") "Guix_doesnt_want_LookPath\\(\"") |
c6279326 | 455 | (("\\<LooxPath") "LookPath"))) |
f87ea24a DM |
456 | #t)) |
457 | (add-after 'patch-paths 'delete-failing-tests | |
458 | (lambda _ | |
459 | ;; Needs internet access. | |
460 | (delete-file "builder/remotecontext/git/gitutils_test.go") | |
461 | ;; Permission denied. | |
462 | (delete-file "daemon/graphdriver/devmapper/devmapper_test.go") | |
463 | ;; Operation not permitted (idtools.MkdirAllAndChown). | |
464 | (delete-file "daemon/graphdriver/vfs/vfs_test.go") | |
465 | ;; Timeouts after 5 min. | |
466 | (delete-file "plugin/manager_linux_test.go") | |
8cd95860 | 467 | ;; Operation not permitted. |
74bf1b5d | 468 | (delete-file "daemon/graphdriver/btrfs/btrfs_test.go") |
8cd95860 DM |
469 | (delete-file "daemon/graphdriver/overlay/overlay_test.go") |
470 | (delete-file "daemon/graphdriver/overlay2/overlay_test.go") | |
f87ea24a DM |
471 | #t)) |
472 | (replace 'configure | |
473 | (lambda _ | |
474 | (setenv "DOCKER_GITCOMMIT" (string-append "v" ,%docker-version)) | |
475 | ;; Automatically use bundled dependencies. | |
476 | ;; TODO: Unbundle - see file "vendor.conf". | |
477 | (setenv "AUTO_GOPATH" "1") | |
478 | ;; Respectively, strip the symbol table and debug | |
479 | ;; information, and the DWARF symbol table. | |
480 | (setenv "LDFLAGS" "-s -w") | |
481 | ;; Make build faster | |
482 | (setenv "GOCACHE" "/tmp") | |
483 | #t)) | |
e3900a4d LF |
484 | (add-before 'build 'setup-go-environment |
485 | (assoc-ref go:%standard-phases 'setup-go-environment)) | |
f87ea24a DM |
486 | (replace 'build |
487 | (lambda _ | |
488 | ;; Our LD doesn't like the statically linked relocatable things | |
489 | ;; that go produces, so install the dynamic version of | |
490 | ;; dockerd instead. | |
491 | (invoke "hack/make.sh" "dynbinary"))) | |
492 | (replace 'check | |
493 | (lambda _ | |
494 | ;; The build process generated a file because the environment | |
495 | ;; variable "AUTO_GOPATH" was set. Use it. | |
496 | (setenv "GOPATH" (string-append (getcwd) "/.gopath")) | |
497 | ;; ".gopath/src/github.com/docker/docker" is a link to the current | |
498 | ;; directory and chdir would canonicalize to that. | |
499 | ;; But go needs to have the uncanonicalized directory name, so | |
500 | ;; store that. | |
501 | (setenv "PWD" (string-append (getcwd) | |
c6279326 | 502 | "/.gopath/src/github.com/docker/docker")) |
f87ea24a DM |
503 | (with-directory-excursion ".gopath/src/github.com/docker/docker" |
504 | (invoke "hack/test/unit")) | |
505 | (setenv "PWD" #f) | |
506 | #t)) | |
507 | (replace 'install | |
508 | (lambda* (#:key outputs #:allow-other-keys) | |
509 | (let* ((out (assoc-ref outputs "out")) | |
510 | (out-bin (string-append out "/bin"))) | |
511 | (install-file "bundles/dynbinary-daemon/dockerd" out-bin) | |
512 | (install-file "bundles/dynbinary-daemon/dockerd-dev" out-bin) | |
513 | #t)))))) | |
514 | (inputs | |
515 | `(("btrfs-progs" ,btrfs-progs) | |
c6279326 | 516 | ("containerd" ,containerd) ; for containerd-shim |
58adcaa1 | 517 | ("coreutils" ,coreutils) |
6b6a25d4 | 518 | ("dbus" ,dbus) |
80fec17f | 519 | ("docker-proxy" ,docker-libnetwork-cmd-proxy) |
58adcaa1 | 520 | ("e2fsprogs" ,e2fsprogs) |
6b6a25d4 | 521 | ("git" ,git) |
f87ea24a DM |
522 | ("iproute2" ,iproute) |
523 | ("iptables" ,iptables) | |
58adcaa1 | 524 | ("kmod" ,kmod) |
f87ea24a DM |
525 | ("libseccomp" ,libseccomp) |
526 | ("pigz" ,pigz) | |
527 | ("procps" ,procps) | |
58adcaa1 | 528 | ("runc" ,runc) |
f87ea24a DM |
529 | ("util-linux" ,util-linux) |
530 | ("lvm2" ,lvm2) | |
531 | ("xfsprogs" ,xfsprogs))) | |
532 | (native-inputs | |
c6279326 | 533 | `(("eudev" ,eudev) ; TODO: Should be propagated by lvm2 (.pc -> .pc) |
f87ea24a DM |
534 | ("go" ,go) |
535 | ("pkg-config" ,pkg-config))) | |
536 | (synopsis "Docker container component library, and daemon") | |
537 | (description "This package provides a framework to assemble specialized | |
538 | container systems. It includes components for orchestration, image | |
539 | management, secret management, configuration management, networking, | |
540 | provisioning etc.") | |
541 | (home-page "https://mobyproject.org/") | |
542 | (license license:asl2.0))) | |
e9b31645 DM |
543 | |
544 | (define-public docker-cli | |
545 | (package | |
546 | (name "docker-cli") | |
547 | (version %docker-version) | |
548 | (source | |
549 | (origin | |
550 | (method git-fetch) | |
551 | (uri (git-reference | |
552 | (url "https://github.com/docker/cli.git") | |
553 | (commit (string-append "v" version)))) | |
554 | (file-name (git-file-name name version)) | |
555 | (sha256 | |
0e84987f | 556 | (base32 "0mxxjzkwdny8p2dmyjich7x1gn7hdlfppzjy2skk2k5bwv7nxpmi")))) |
e9b31645 DM |
557 | (build-system go-build-system) |
558 | (arguments | |
559 | `(#:import-path "github.com/docker/cli" | |
560 | ;; TODO: Tests require a running Docker daemon. | |
561 | #:tests? #f | |
562 | #:phases | |
563 | (modify-phases %standard-phases | |
564 | (add-before 'build 'setup-environment-2 | |
565 | (lambda _ | |
566 | ;; Respectively, strip the symbol table and debug | |
567 | ;; information, and the DWARF symbol table. | |
568 | (setenv "LDFLAGS" "-s -w") | |
569 | ||
570 | ;; Make build reproducible. | |
571 | (setenv "BUILDTIME" "1970-01-01 00:00:01.000000000+00:00") | |
572 | (symlink "src/github.com/docker/cli/scripts" "./scripts") | |
573 | (symlink "src/github.com/docker/cli/docker.Makefile" "./docker.Makefile") | |
574 | #t)) | |
575 | (replace 'build | |
576 | (lambda _ | |
577 | (invoke "./scripts/build/dynbinary"))) | |
578 | (replace 'check | |
579 | (lambda* (#:key make-flags tests? #:allow-other-keys) | |
580 | (setenv "PATH" (string-append (getcwd) "/build:" (getenv "PATH"))) | |
581 | (if tests? | |
582 | ;; Use the newly-built docker client for the tests. | |
583 | (with-directory-excursion "src/github.com/docker/cli" | |
584 | ;; TODO: Run test-e2e as well? | |
585 | (apply invoke "make" "-f" "docker.Makefile" "test-unit" | |
586 | (or make-flags '()))) | |
587 | #t))) | |
588 | (replace 'install | |
589 | (lambda* (#:key outputs #:allow-other-keys) | |
590 | (let* ((out (assoc-ref outputs "out")) | |
591 | (out-bin (string-append out "/bin"))) | |
592 | (chdir "build") | |
e9b31645 DM |
593 | (install-file "docker" out-bin) |
594 | #t)))))) | |
595 | (native-inputs | |
596 | `(("go" ,go) | |
597 | ("libltdl" ,libltdl) | |
598 | ("pkg-config" ,pkg-config))) | |
599 | (synopsis "Command line interface to Docker") | |
600 | (description "This package provides a command line interface to Docker.") | |
17d25019 | 601 | (home-page "https://www.docker.com/") |
e9b31645 | 602 | (license license:asl2.0))) |
975a953b MC |
603 | |
604 | (define-public cqfd | |
605 | (package | |
606 | (name "cqfd") | |
607 | (version "5.0.1") | |
608 | (source (origin | |
609 | (method git-fetch) | |
610 | (uri (git-reference | |
611 | (url "https://github.com/savoirfairelinux/cqfd.git") | |
612 | (commit (string-append "v" version)))) | |
613 | (file-name (git-file-name name version)) | |
614 | (sha256 | |
615 | (base32 | |
616 | "1z4v16lbpbwd5ykawizdclpryp2k006lbk2mv427a4b3nvcd9wik")))) | |
617 | (build-system gnu-build-system) | |
618 | (arguments | |
619 | ;; The test suite requires a docker daemon and connectivity. | |
620 | `(#:tests? #f | |
621 | #:phases | |
622 | (modify-phases %standard-phases | |
623 | (delete 'configure) | |
624 | (delete 'build) | |
625 | (replace 'install | |
626 | (lambda* (#:key outputs #:allow-other-keys) | |
627 | (let ((out (assoc-ref outputs "out"))) | |
628 | ;; Fix the directory of the bash completion. | |
629 | (substitute* "Makefile" | |
630 | (("completionsdir=.*$") | |
631 | (string-append "completionsdir=" out | |
632 | "/etc/bash_completion.d; \\\n"))) | |
633 | (invoke "make" "install" | |
634 | (string-append "PREFIX=" out)))))))) | |
635 | (home-page "https://github.com/savoirfairelinux/cqfd") | |
636 | (synopsis "Convenience wrapper for Docker") | |
637 | (description "cqfd is a Bash script that provides a quick and convenient | |
638 | way to run commands in the ecurrent directory, but within a Docker container | |
639 | defined in a per-project configuration file.") | |
640 | (license license:gpl3+))) |