projects/guix·blob java-team · refs

2221 lines · 87.8 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2018 宋文武 <[email protected]>
3;;; Copyright © 2019 Leo Famulari <[email protected]>
4;;; Copyright © 2018, 2019, 2021, 2022, 2024 Tobias Geerinckx-Rice <[email protected]>
5;;; Copyright © 2020 Jelle Licht <[email protected]>
6;;; Copyright © 2020 Ludovic Courtès <[email protected]>
7;;; Copyright © 2021 Léo Le Bouter <[email protected]>
8;;; Copyright © 2021 Maxim Cournoyer <[email protected]>
9;;; Copyright © 2021 Timmy Douglas <[email protected]>
10;;; Copyright © 2022 Michael Rohleder <[email protected]>
11;;; Copyright © 2022 Pierre Langlois <[email protected]>
12;;; Copyright © 2022 Zhu Zihao <[email protected]>
13;;; Copyright © 2023 Hilton Chain <[email protected]>
14;;; Copyright © 2023 Ricardo Wurmus <[email protected]>
15;;; Copyright © 2023 Zongyuan Li <[email protected]>
16;;; Copyright © 2024 Ashish SHUKLA <[email protected]>
17;;; Copyright © 2024 Foundation Devices, Inc. <[email protected]>
18;;; Copyright © 2024 Jean-Pierre De Jesus DIAZ <[email protected]>
19;;; Copyright © 2024-2026 Sharlatan Hellseher <[email protected]>
20;;; Copyright © 2024-2026 Tomas Volf <[email protected]>
21;;; Copyright © 2025, 2026 Foster Hangdaan <[email protected]>
22;;; Copyright © 2026 Giacomo Leidi <[email protected]>
23;;; Copyright © 2026 Konstantin Suntsov <[email protected]>
24;;;
25;;; This file is part of GNU Guix.
26;;;
27;;; GNU Guix is free software; you can redistribute it and/or modify it
28;;; under the terms of the GNU General Public License as published by
29;;; the Free Software Foundation; either version 3 of the License, or (at
30;;; your option) any later version.
31;;;
32;;; GNU Guix is distributed in the hope that it will be useful, but
33;;; WITHOUT ANY WARRANTY; without even the implied warranty of
34;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
35;;; GNU General Public License for more details.
36;;;
37;;; You should have received a copy of the GNU General Public License
38;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
39
40(define-module (gnu packages containers)
41 #:use-module (guix gexp)
42 #:use-module ((guix licenses) #:prefix license:)
43 #:use-module (guix modules)
44 #:use-module (gnu packages)
45 #:use-module (guix packages)
46 #:use-module (guix download)
47 #:use-module (guix git-download)
48 #:use-module (guix build-system copy)
49 #:use-module (guix build-system gnu)
50 #:use-module (guix build-system go)
51 #:use-module (guix build-system guile)
52 #:use-module (guix build-system meson)
53 #:use-module (guix build-system pyproject)
54 #:use-module ((guix search-paths) #:select ($GUIX_EXTENSIONS_PATH))
55 #:use-module (guix utils)
56 #:use-module (gnu packages admin)
57 #:use-module (gnu packages autotools)
58 #:use-module (gnu packages base)
59 #:use-module (gnu packages bash)
60 #:use-module (gnu packages check)
61 #:use-module (gnu packages compression)
62 #:use-module (gnu packages docker)
63 #:use-module (gnu packages glib)
64 #:use-module (gnu packages gcc)
65 #:use-module (gnu packages gettext)
66 #:use-module (gnu packages gnupg)
67 #:use-module (gnu packages golang)
68 #:use-module (gnu packages golang-build)
69 #:use-module (gnu packages golang-check)
70 #:use-module (gnu packages golang-compression)
71 #:use-module (gnu packages golang-crypto)
72 #:use-module (gnu packages golang-maths)
73 #:use-module (gnu packages golang-web)
74 #:use-module (gnu packages golang-xyz)
75 #:use-module (gnu packages guile)
76 #:use-module (gnu packages guile-xyz)
77 #:use-module (gnu packages linux)
78 #:use-module (gnu packages man)
79 #:use-module (gnu packages pcre)
80 #:use-module (gnu packages python)
81 #:use-module (gnu packages networking)
82 #:use-module (gnu packages package-management)
83 #:use-module (gnu packages pkg-config)
84 #:use-module (gnu packages prometheus)
85 #:use-module (gnu packages python-xyz)
86 #:use-module (gnu packages python-build)
87 #:use-module (gnu packages python-check)
88 #:use-module (gnu packages rust-apps)
89 #:use-module (gnu packages selinux)
90 #:use-module (gnu packages version-control)
91 #:use-module (gnu packages web)
92 #:use-module (gnu packages wget))
93
94;;; Code:
95
96;;;
97;;; Libraries:
98;;;
99
100(define-public go-github-com-checkpoint-restore-checkpointctl
101 (package
102 (name "go-github-com-checkpoint-restore-checkpointctl")
103 (version "1.5.0")
104 (source
105 (origin
106 (method git-fetch)
107 (uri (git-reference
108 (url "https://github.com/checkpoint-restore/checkpointctl")
109 (commit (string-append "v" version))))
110 (file-name (git-file-name name version))
111 (sha256
112 (base32 "0qvgld9vji5f7h2idk6r3q30909hqws0rkpvgina43i57bsfh2sv"))
113 (snippet
114 #~(begin
115 (use-modules (guix build utils))
116 (delete-file-recursively "vendor")))))
117 (build-system go-build-system)
118 (arguments
119 (list
120 #:skip-build? #t
121 #:import-path "github.com/checkpoint-restore/checkpointctl"))
122 (native-inputs
123 (list go-github-com-spf13-cobra))
124 (propagated-inputs
125 (list go-github-com-checkpoint-restore-go-criu-v8
126 go-github-com-containers-storage
127 go-github-com-opencontainers-runtime-spec
128 go-github-com-xlab-treeprint))
129 (home-page "https://github.com/checkpoint-restore/checkpointctl")
130 (synopsis "Tool for in-depth analysis of container checkpoints")
131 (description
132 "This package provides a Go library to read and manipulate checkpoint
133archives as created by Podman, CRI-O and containerd.")
134 (license license:asl2.0)))
135
136(define-public go-github-com-containerd-accelerated-container-image
137 (package
138 (name "go-github-com-containerd-accelerated-container-image")
139 (version "1.4.3")
140 (source
141 (origin
142 (method git-fetch)
143 (uri (git-reference
144 (url "https://github.com/containerd/accelerated-container-image")
145 (commit (string-append "v" version))))
146 (file-name (git-file-name name version))
147 (sha256
148 (base32 "086ywdk8mnqnjj3a07ggcyf52cqqsr8cbx2iw2qrncd1slb9l0vv"))
149 (modules '((guix build utils)))
150 (snippet
151 #~(begin
152 ;; It requires Windows-only packages in check phase
153 ;; (go-github-com-microsoft-hcsshim)
154 (delete-file-recursively "cmd/ctr")))))
155 (build-system go-build-system)
156 (arguments
157 (list
158 #:skip-build? #t
159 #:import-path "github.com/containerd/accelerated-container-image"
160 #:test-flags
161 ;; Requires network connection
162 #~(list "-skip" "TestConvertReferrer")))
163 (native-inputs
164 (list go-github-com-containerd-log
165 go-github-com-prometheus-client-golang
166 go-github-com-sirupsen-logrus
167 go-github-com-spf13-cobra
168 go-github-com-urfave-cli-v2))
169 (propagated-inputs
170 (list go-github-com-containerd-containerd-api
171 go-github-com-containerd-containerd-v2
172 go-github-com-containerd-continuity
173 go-github-com-containerd-errdefs
174 go-github-com-containerd-go-cni
175 go-github-com-containerd-platforms
176 go-github-com-data-accelerator-zdfs
177 go-github-com-docker-go-units
178 go-github-com-go-sql-driver-mysql
179 go-github-com-moby-locker
180 go-github-com-moby-sys-mountinfo
181 go-github-com-opencontainers-go-digest
182 go-github-com-opencontainers-image-spec
183 go-github-com-opencontainers-runtime-spec
184 go-golang-org-x-sync
185 go-golang-org-x-sys
186 go-google-golang-org-grpc
187 go-oras-land-oras-go-v2))
188 (home-page "https://github.com/containerd/accelerated-container-image")
189 (synopsis "Remote container image format")
190 (description
191 "Accelerated Container Image is an implementation of paper
192@url{https://www.usenix.org/conference/atc20/presentation/li-huiba, DADI:
193Block-Level Image Service for Agile and Elastic Application Deployment. USENIX
194ATC'20}.")
195 (license license:asl2.0)))
196
197(define-public go-github-com-containerd-accelerated-container-image-pkg-types
198 ;; Submodule to break cycle in github.com/data-accelerator/zdfs.
199 (hidden-package
200 (package
201 (name "go-github-com-containerd-accelerated-container-image-pkg-types")
202 (version "1.4.3")
203 (source
204 (origin
205 (method git-fetch)
206 (uri (git-reference
207 (url "https://github.com/containerd/accelerated-container-image")
208 (commit (string-append "v" version))))
209 (file-name (git-file-name name version))
210 (sha256
211 (base32 "086ywdk8mnqnjj3a07ggcyf52cqqsr8cbx2iw2qrncd1slb9l0vv"))
212 (modules '((guix build utils)
213 (ice-9 ftw)
214 (srfi srfi-26)))
215 (snippet
216 #~(begin
217 (define (delete-all-but directory . preserve)
218 (define (directory? x)
219 (and=> (stat x #f)
220 (compose (cut eq? 'directory <>) stat:type)))
221 (with-directory-excursion directory
222 (let* ((pred
223 (negate (cut member <> (append '("." "..") preserve))))
224 (items (scandir "." pred)))
225 (for-each (lambda (item)
226 (if (directory? item)
227 (delete-file-recursively item)
228 (delete-file item)))
229 items))))
230 (delete-all-but "." "pkg")
231 (delete-all-but "pkg" "types")))))
232 (build-system go-build-system)
233 (arguments
234 (list
235 #:skip-build? #t
236 #:tests? #f
237 #:import-path "github.com/containerd/accelerated-container-image"))
238 (home-page "https://github.com/containerd/accelerated-container-image")
239 (synopsis "Remote container image format types")
240 (description
241 "This packages provides types from
242@url{https://github.com/containerd/accelerated-container-image}.")
243 (license license:asl2.0))))
244
245(define-public go-github-com-containerd-aufs
246 (package
247 (name "go-github-com-containerd-aufs")
248 (version "1.0.0")
249 (source
250 (origin
251 (method git-fetch)
252 (uri (git-reference
253 (url "https://github.com/containerd/aufs")
254 (commit (string-append "v" version))))
255 (file-name (git-file-name name version))
256 (sha256
257 (base32 "0jyyyf6sr910m602axmp4h4j1l2n680cpp60z09pvprz55zi4ba0"))))
258 (build-system go-build-system)
259 (arguments
260 (list
261 #:skip-build? #t ;source only package
262 #:tests? #f
263 #:import-path "github.com/containerd/aufs"))
264 (propagated-inputs
265 (list ;; go-github-com-containerd-containerd ; cycles
266 go-github-com-containerd-continuity
267 go-github-com-pkg-errors
268 go-golang-org-x-sys))
269 (home-page "https://github.com/containerd/aufs")
270 (synopsis "AUFS snapshotter containerd v1")
271 (description
272 "This package provides an @acronym{Advanced multi-layered Unification
273FilesyStem, AUFS} implementation of the snapshot interface for containerd.")
274 (license license:asl2.0)))
275
276(define-public go-github-com-containerd-containerd-v2
277 (package
278 (name "go-github-com-containerd-containerd-v2")
279 (version "2.2.3")
280 (source
281 (origin
282 (method git-fetch)
283 (uri (git-reference
284 (url "https://github.com/containerd/containerd")
285 (commit (string-append "v" version))))
286 (file-name (git-file-name name version))
287 (sha256
288 (base32 "0wxy5np689571s6lw77mx63nw75fx85w5svi0jplksmqzmjqp8wd"))
289 (snippet
290 #~(begin (use-modules (guix build utils))
291 (delete-file-recursively "vendor")
292 ;; Submodules with their own go.mod files and packaged separately:
293 ;;
294 ;; - github.com/containerd/containerd/api
295 (delete-file-recursively "api")))))
296 (build-system go-build-system)
297 (arguments
298 (list
299 #:skip-build? #t
300 #:import-path "github.com/containerd/containerd/v2"
301 #:test-subdirs
302 #~(list "cmd/protoc-gen-go-fieldpath/..."
303 "core/containers/..."
304 "core/content/..."
305 "core/diff"
306 "core/diff/apply"
307 "core/events/..."
308 "core/images/..."
309 "core/introspection/..."
310 "core/leases/..."
311 "core/metrics/..."
312 "core/remotes/..."
313 "core/sandbox/..."
314 "core/streaming/..."
315 "core/transfer"
316 "core/transfer/archive/..."
317 "core/transfer/image/..."
318 "core/transfer/local/..."
319 "core/transfer/plugins/..."
320 "core/transfer/streaming/..."
321 "core/unpack/..."
322 "internal/cleanup/..."
323 "internal/erofsutils/..."
324 "internal/eventq/..."
325 "internal/failpoint/..."
326 "internal/fsverity/..."
327 "internal/kmutex/..."
328 "internal/lazyregexp/..."
329 "internal/pprof/..."
330 "internal/randutil/..."
331 "internal/registrar/..."
332 "internal/tomlext/..."
333 "internal/truncindex/..."
334 "internal/userns/..."
335 "internal/wintls/..."
336 "pkg/apparmor/..."
337 "pkg/archive/..."
338 "pkg/atomicfile/..."
339 "pkg/blockio/..."
340 "pkg/cap/..."
341 "pkg/cio..."
342 "pkg/deprecation/..."
343 "pkg/dialer/..."
344 "pkg/display/..."
345 "pkg/epoch/..."
346 "pkg/fifosync/..."
347 "pkg/filters/..."
348 "pkg/gc/..."
349 "pkg/httpdbg/..."
350
351 ;; TODO: Check why these submodule fail to build.
352 ;; "client/..."
353 ;; "cmd/containerd-shim-runc-v2/..."
354 ;; "cmd/containerd-stress/..."
355 ;; "cmd/containerd/..."
356 ;; "cmd/ctr/..."
357 ;; "cmd/gen-manpages/..."
358 ;; "contrib/..."
359 ;; "core/diff/proxy"
360 ;; "core/metadata/..."
361 ;; "core/mount/..."
362 ;; "core/runtime/..."
363 ;; "core/snapshots/..."
364 ;; "core/transfer/proxy/..."
365 ;; "core/transfer/registry/..."
366 ;; "integration/..."
367 ;; "internal/cri/..."
368 ;; "internal/nri/..."
369 ;; "pkg/cdi/..."
370 #;"plugins/...")
371 #:test-flags
372 #~(list "-skip" (string-join
373 ;; panic: cannot statfs cgroup root [recovered]
374 (list "TestValidateConfig"
375 ;; io_test.go:40: failed to start binary process:
376 ;; fork/exec /bin/echo: no such file or directory
377 "TestNewBinaryIO"
378 ;; expected success: got executable file not found in $PATH
379 "TestExecutorWithArgs"
380 "TestSetEnv"
381 "TestStdIOPipes"
382 ;; panic: cannot statfs cgroup root
383 "TestContainerCapabilities"
384 "TestContainerSpecTty"
385 "TestContainerSpecReadonlyRootfs"
386 "TestContainerSpecWithExtraMounts"
387 "TestContainerAndSandboxPrivileged"
388 "TestPrivilegedBindMount"
389 "TestCgroupNamespace"
390 "TestPidNamespace/node_namespace_mode"
391 ;; failed to apply b: invalid argument
392 "TestDiffTar/IgnoreSockets"
393 "TestBinDirVerifyImage/max_verifiers_=_-1,_with_timeout"
394 "TestContainerSpecDefaultPath"
395 ;; Error: Not equal:
396 ;; expected: 1000
397 ;; actual : 123
398 "TestSetPositiveOomScoreAdjustment")
399 "|"))))
400 (native-inputs
401 (list go-github-com-stretchr-testify))
402 (propagated-inputs
403 (list go-dario-cat-mergo
404 go-github-com-adalogics-go-fuzz-headers
405 go-github-com-checkpoint-restore-checkpointctl
406 go-github-com-checkpoint-restore-go-criu-v7
407 go-github-com-containerd-btrfs-v2
408 go-github-com-containerd-cgroups-v3
409 go-github-com-containerd-console
410 go-github-com-containerd-containerd-api
411 go-github-com-containerd-continuity
412 go-github-com-containerd-errdefs
413 go-github-com-containerd-errdefs-pkg
414 go-github-com-containerd-fifo
415 go-github-com-containerd-go-cni
416 go-github-com-containerd-go-runc
417 go-github-com-containerd-imgcrypt-v2
418 go-github-com-containerd-log
419 go-github-com-containerd-nri
420 go-github-com-containerd-otelttrpc
421 go-github-com-containerd-platforms
422 go-github-com-containerd-plugin
423 go-github-com-containerd-ttrpc
424 go-github-com-containerd-typeurl-v2
425 go-github-com-containerd-zfs-v2
426 go-github-com-containernetworking-cni
427 go-github-com-containernetworking-plugins
428 go-github-com-coreos-go-systemd-v22
429 go-github-com-davecgh-go-spew
430 go-github-com-distribution-reference
431 go-github-com-docker-go-events
432 go-github-com-docker-go-metrics
433 go-github-com-docker-go-units
434 go-github-com-emicklei-go-restful-v3
435 go-github-com-fsnotify-fsnotify
436 go-github-com-google-certtostore
437 go-github-com-google-go-cmp
438 go-github-com-google-uuid
439 go-github-com-grpc-ecosystem-go-grpc-middleware-providers-prometheus
440 go-github-com-intel-goresctrl
441 go-github-com-klauspost-compress
442 go-github-com-mdlayher-vsock
443 ;;go-github-com-microsoft-go-winio ;Windows only
444 ;;go-github-com-microsoft-hcsshim ;Windows only
445 go-github-com-moby-locker
446 go-github-com-moby-sys-mountinfo
447 go-github-com-moby-sys-sequential
448 go-github-com-moby-sys-signal
449 go-github-com-moby-sys-symlink
450 go-github-com-moby-sys-user
451 go-github-com-moby-sys-userns
452 go-github-com-opencontainers-go-digest
453 go-github-com-opencontainers-image-spec
454 go-github-com-opencontainers-runtime-spec
455 go-github-com-opencontainers-runtime-tools
456 go-github-com-opencontainers-selinux
457 go-github-com-pelletier-go-toml-v2
458 go-github-com-prometheus-client-golang
459 go-github-com-sirupsen-logrus
460 go-github-com-tchap-go-patricia-v2
461 go-github-com-urfave-cli-v2
462 go-github-com-vishvananda-netlink
463 go-github-com-vishvananda-netns
464 go-go-etcd-io-bbolt
465 go-go-opentelemetry-io-contrib-instrumentation-google-golang-org-grpc-otelgrpc
466 go-go-opentelemetry-io-contrib-instrumentation-net-http-otelhttp
467 go-go-opentelemetry-io-otel
468 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace
469 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracegrpc
470 go-go-opentelemetry-io-otel-exporters-otlp-otlptrace-otlptracehttp
471 go-go-opentelemetry-io-otel-sdk
472 go-go-opentelemetry-io-otel-trace
473 go-go-uber-org-goleak
474 go-golang-org-x-mod
475 go-golang-org-x-sync
476 go-golang-org-x-sys
477 go-golang-org-x-time
478 go-google-golang-org-genproto-googleapis-rpc
479 go-google-golang-org-grpc
480 go-google-golang-org-protobuf
481 go-gopkg-in-inf-v0
482 go-k8s-io-apimachinery
483 go-k8s-io-client-go
484 go-k8s-io-cri-api
485 go-k8s-io-klog-v2
486 go-tags-cncf-io-container-device-interface))
487 (home-page "https://containerd.io/")
488 (synopsis "Container runtime support daemon")
489 (description
490 "Containerd is a container runtime with an emphasis on simplicity,
491robustness, and portability. It is available as a daemon, which can manage
492the complete container lifecycle of its host system: image transfer and
493storage, container execution and supervision, low-level storage and network
494attachments, etc.")
495 (license license:asl2.0)))
496
497(define-public go-github-com-containerd-stargz-snapshotter
498 (package
499 (name "go-github-com-containerd-stargz-snapshotter")
500 (version "0.18.2")
501 (source
502 (origin
503 (method git-fetch)
504 (uri (git-reference
505 (url "https://github.com/containerd/stargz-snapshotter")
506 (commit (string-append "v" version))))
507 (file-name (git-file-name name version))
508 (sha256
509 (base32 "06nksi5xpbys6bfqsfm7bax9lxnwynl7y3hw6pcxhv5hckxnb8fp"))
510 (modules '((guix build utils)))
511 (snippet
512 #~(begin
513 ;; Submodules with their own go.mod files and packaged separately:
514 (delete-file-recursively "cmd")
515 (delete-file-recursively "estargz")
516 (delete-file-recursively "ipfs")))))
517 (build-system go-build-system)
518 (arguments
519 (list
520 #:skip-build? #t
521 #:import-path "github.com/containerd/stargz-snapshotter"
522 ;; TODO: Remove when all transitive inputs are packaged.
523 #:test-subdirs
524 #~(list "fs" "task" "cache" "estargz" "fs/layer" "fs/reader"
525 "fs/remote" "util/cacheutil" "metadata/memory"
526 "analyzer/recorder" "estargz/errorutil" "estargz/externaltoc"
527 "estargz/zstdchunked" "util/decompressutil")))
528 (propagated-inputs
529 (list go-github-com-containerd-console
530 go-github-com-containerd-containerd-v2
531 go-github-com-containerd-continuity
532 go-github-com-containerd-errdefs
533 go-github-com-containerd-log
534 go-github-com-containerd-platforms
535 go-github-com-containerd-plugin
536 go-github-com-distribution-reference
537 go-github-com-docker-cli
538 go-github-com-docker-go-metrics
539 go-github-com-gogo-protobuf
540 go-github-com-golang-groupcache
541 go-github-com-hanwen-go-fuse-v2
542 go-github-com-hashicorp-go-retryablehttp
543 go-github-com-klauspost-compress
544 go-github-com-moby-sys-mountinfo
545 go-github-com-opencontainers-go-digest
546 go-github-com-opencontainers-image-spec
547 go-github-com-opencontainers-runtime-spec
548 go-github-com-prometheus-client-golang
549 go-github-com-rs-xid
550 go-github-com-sirupsen-logrus
551 go-go-etcd-io-bbolt
552 go-golang-org-x-sync
553 go-golang-org-x-sys
554 go-google-golang-org-grpc
555 go-k8s-io-api
556 go-k8s-io-apimachinery
557 go-k8s-io-client-go
558 go-k8s-io-cri-api))
559 (home-page "https://github.com/containerd/stargz-snapshotter")
560 (synopsis "Fast container image distribution plugin with lazy pulling")
561 (description
562 "This package provides a container image distribution plugin with lazy
563pulling for Containerd implemented in @code{eStargz} - Standard-Compatible
564Extensions to Tar.gz Layers for Lazy Pulling Container Images.")
565 (license license:asl2.0)))
566
567(define-public go-github-com-containers-gvisor-tap-vsock
568 (package
569 (name "go-github-com-containers-gvisor-tap-vsock")
570 (version "0.8.9")
571 (source
572 (origin
573 (method git-fetch)
574 (uri (git-reference
575 (url "https://github.com/containers/gvisor-tap-vsock")
576 (commit (string-append "v" version))))
577 (file-name (git-file-name name version))
578 (sha256
579 (base32 "1knivsg39x46i4zhbz7cjrcykdkg4xwqy0qf24zyd022hzjznykr"))
580 (modules '((guix build utils)))
581 (snippet
582 #~(begin
583 (delete-file-recursively "vendor")
584 ;; Submodules with their own go.mod files and packaged separately:
585 ;;
586 ;; - github.com/containers/gvisor-tap-vsock/tools
587 (delete-file-recursively "tools")))))
588 (build-system go-build-system)
589 (arguments
590 (list
591 #:skip-build? #t
592 #:import-path "github.com/containers/gvisor-tap-vsock"
593 #:unpack-path "github.com/containers/gvisor-tap-vsock"
594 #:build-flags
595 #~(list (string-append "-ldflags="
596 "-X github.com/containers/gvisor-tap-vsock"
597 "/pkg/types.gitVersion=" #$version))
598 #:test-flags
599 #~(list "-skip"
600 (string-join
601 ;; Received unexpected error:
602 ;; listen unix /tmp/guix-.../test.sock: bind: invalid argument
603 (list "TestNotificationSender_Success"
604 ;; Requires network
605 "TestSuite"
606 "TestDNS")
607 "|"))
608 #:phases
609 #~(modify-phases %standard-phases
610 (add-after 'unpack 'prune-tests
611 (lambda* (#:key unpack-path #:allow-other-keys)
612 (with-directory-excursion (string-append "src/" unpack-path)
613 ;; Requires working DNS.
614 (substitute* "pkg/services/dns/dns_test.go"
615 (("Should pass DNS requests to default system DNS.*" all)
616 (string-append all "\n" "ginkgo.Skip(\"No network.\");"))
617 (("\"redhat.com\",")
618 "\"localhost\",")
619 (("\"52.200.142.250\"")
620 "\"127.0.0.1\""))))))))
621 (native-inputs
622 (list go-github-com-stretchr-testify
623 go-github-com-foxcpp-go-mockdns))
624 (propagated-inputs
625 (list go-github-com-apparentlymart-go-cidr
626 go-github-com-containers-winquit
627 go-github-com-coreos-stream-metadata-go
628 go-github-com-dustin-go-humanize
629 go-github-com-google-gopacket
630 go-github-com-inetaf-tcpproxy
631 go-github-com-insomniacslk-dhcp
632 ;; go-github-com-linuxkit-virtsock ;Windows only
633 go-github-com-mdlayher-vsock
634 ;; go-github-com-microsoft-go-winio ;Windows only
635 go-github-com-miekg-dns
636 go-github-com-onsi-ginkgo
637 go-github-com-onsi-gomega
638 go-github-com-opencontainers-go-digest
639 go-github-com-sirupsen-logrus
640 go-github-com-songgao-packets
641 go-github-com-songgao-water
642 go-github-com-vishvananda-netlink
643 go-golang-org-x-crypto
644 go-golang-org-x-mod
645 go-golang-org-x-sync
646 go-golang-org-x-sys
647 go-gopkg-in-yaml-v3
648 go-gvisor-dev-gvisor-source))
649 (home-page "https://github.com/containers/gvisor-tap-vsock")
650 (synopsis "Network stack for virtualization based on gVisor")
651 (description "This package provides a replacement for @code{libslirp} and
652@code{VPNKit}, written in pure Go. It is based on the network stack of gVisor
653and brings a configurable DNS server and dynamic port forwarding.
654
655It can be used with QEMU, Hyperkit, Hyper-V and User-Mode Linux.
656
657The binary is called @command{gvproxy}.")
658 (license license:asl2.0)))
659
660(define-public go-github-com-data-accelerator-zdfs
661 (package
662 (name "go-github-com-data-accelerator-zdfs")
663 (version "0.1.5")
664 (source
665 (origin
666 (method git-fetch)
667 (uri (git-reference
668 (url "https://github.com/data-accelerator/zdfs")
669 (commit (string-append "v" version))))
670 (file-name (git-file-name name version))
671 (sha256
672 (base32 "0j2xr9li2qciqdi6is82aw3fx1lm673bfddgfg3zhbpx3r95mwsy"))))
673 (build-system go-build-system)
674 (arguments
675 (list
676 #:import-path "github.com/data-accelerator/zdfs"))
677 (native-inputs
678 (list go-github-com-stretchr-testify
679 go-github-com-containerd-accelerated-container-image-pkg-types))
680 (propagated-inputs
681 (list go-github-com-containerd-containerd-v2
682 go-github-com-containerd-continuity
683 go-github-com-distribution-reference
684 go-github-com-pkg-errors
685 go-github-com-sirupsen-logrus))
686 (home-page "https://github.com/data-accelerator/zdfs")
687 (synopsis "Extension package of Overlaybd-snapshotter")
688 (description
689 "This package provides an extension overlaybd-snapshotter. It constructs
690the overlaybd image in OCIv1 tgz format through a tricky method which makes
691'overlaybd-snapshotter' adapter for a normal OCIv1 image.")
692 (license license:asl2.0)))
693
694(define-public go-github-com-opencontainers-image-spec-schema
695 (package
696 (name "go-github-com-opencontainers-image-spec-schema")
697 (version "0.0.0-20260514171043-13cff54902ec")
698 (source
699 (origin
700 (method git-fetch)
701 (uri (git-reference
702 (url "https://github.com/opencontainers/image-spec")
703 (commit (go-version->git-ref version))))
704 (file-name (git-file-name name version))
705 (sha256
706 (base32 "0jg1wfbr6rva24cz6q6d73wgaridzkh9sclzm2dwxpiwmbkcas38"))
707 (modules '((guix build utils)
708 (ice-9 ftw)
709 (srfi srfi-26)))
710 (snippet
711 #~(begin
712 (define (delete-all-but directory . preserve)
713 (define (directory? x)
714 (and=> (stat x #f)
715 (compose (cut eq? 'directory <>) stat:type)))
716 (with-directory-excursion directory
717 (let* ((pred
718 (negate (cut member <> (append '("." "..") preserve))))
719 (items (scandir "." pred)))
720 (for-each (lambda (item)
721 (if (directory? item)
722 (delete-file-recursively item)
723 (delete-file item)))
724 items))))
725 (delete-all-but "." "schema")))))
726 (build-system go-build-system)
727 (arguments
728 (list
729 #:embed-files
730 ;; For go-github-com-santhosh-tekuri-jsonschema-v6:
731 #~(list "applicator"
732 "content"
733 "core"
734 "format"
735 "format-annotation"
736 "format-assertion"
737 "meta-data"
738 "schema"
739 "unevaluated"
740 "validation")
741 #:import-path "github.com/opencontainers/image-spec/schema"
742 #:unpack-path "github.com/opencontainers/image-spec"))
743 (propagated-inputs
744 (list go-github-com-opencontainers-go-digest
745 go-github-com-opencontainers-image-spec
746 go-github-com-russross-blackfriday-v2
747 go-github-com-santhosh-tekuri-jsonschema-v6))
748 (home-page "https://github.com/opencontainers/image-spec")
749 (synopsis "OCI Image Format")
750 (description
751 "Package schema defines the OCI image media types, schema definitions and
752validation functions.")
753 (license license:asl2.0)))
754
755(define-public go-github-com-opencontainers-image-tools
756 (package
757 (name "go-github-com-opencontainers-image-tools")
758 (version "0.3.0")
759 (source
760 (origin
761 (method git-fetch)
762 (uri (git-reference
763 (url "https://github.com/opencontainers/image-tools")
764 (commit (string-append "v" version))))
765 (file-name (git-file-name name version))
766 (sha256
767 (base32 "0drxjgcxm268cwv547anl23rv1jx7mvdfxp7nxr6fjbzpxav6bd2"))))
768 (build-system go-build-system)
769 (arguments
770 (list
771 #:skip-build? #t
772 #:import-path "github.com/opencontainers/image-tools"))
773 (home-page "https://github.com/opencontainers/image-tools")
774 (synopsis "OCI Image Tooling")
775 (description
776 "@code{oci-image-tool} is a collection of tools for working with the
777@url{https://github.com/opencontainers/image-spec, OCI image format
778specification}.")
779 (license license:asl2.0)))
780
781(define-public go-github-com-rootless-containers-rootlesskit-v3
782 (package
783 (name "go-github-com-rootless-containers-rootlesskit-v3")
784 (version "3.0.0")
785 (source
786 (origin
787 (method git-fetch)
788 (uri (git-reference
789 (url "https://github.com/rootless-containers/rootlesskit")
790 (commit (string-append "v" version))))
791 (file-name (git-file-name name version))
792 (sha256
793 (base32 "0giw1whjpm64h8f1iamgym246rr3wl01w7zgw4lygrj7dqk3clmb"))))
794 (build-system go-build-system)
795 (arguments
796 (list
797 #:skip-build? #t
798 #:import-path "github.com/rootless-containers/rootlesskit/v3"))
799 (propagated-inputs
800 (list go-github-com-containernetworking-plugins
801 go-github-com-containers-gvisor-tap-vsock
802 go-github-com-gofrs-flock
803 go-github-com-google-uuid
804 go-github-com-gorilla-mux
805 go-github-com-insomniacslk-dhcp
806 go-github-com-masterminds-semver-v3
807 go-github-com-moby-sys-mountinfo
808 go-github-com-moby-vpnkit
809 go-github-com-sirupsen-logrus
810 go-github-com-songgao-water
811 go-github-com-urfave-cli-v2
812 go-golang-org-x-sync
813 go-golang-org-x-sys
814 go-gotest-tools-v3))
815 (home-page "https://github.com/rootless-containers/rootlesskit")
816 (synopsis "Linux-native fakeroot using user namespaces in Golang")
817 (description
818 "@code{RootlessKit} is a Linux-native implementation of \"fake root\" using
819@url{http://man7.org/linux/man-pages/man7/user_namespaces.7.html,(code
820user_namespaces(7))}. It is used to run containers engines as an
821unprivileged user, known as \"Rootless mode\".")
822 (license license:asl2.0)))
823
824(define-public go-go-podman-io-common
825 (package
826 (name "go-go-podman-io-common")
827 (version "0.68.1")
828 (source
829 (origin
830 (method git-fetch)
831 (uri (git-reference
832 (url "https://github.com/podman-container-tools/container-libs")
833 (commit (go-version->git-ref version #:subdir "common"))))
834 (file-name (git-file-name name version))
835 (sha256
836 (base32 "040snqsg3il98pz9w8442wdzwm2rm07yqbch87f4jic4p4s0707s"))
837 (modules '((guix build utils)
838 (ice-9 ftw)
839 (srfi srfi-26)))
840 (snippet
841 #~(begin
842 (define (delete-all-but directory . preserve)
843 (define (directory? x)
844 (and=> (stat x #f)
845 (compose (cut eq? 'directory <>) stat:type)))
846 (with-directory-excursion directory
847 (let* ((pred
848 (negate (cut member <> (append '("." "..") preserve))))
849 (items (scandir "." pred)))
850 (for-each (lambda (item)
851 (if (directory? item)
852 (delete-file-recursively item)
853 (delete-file item)))
854 items))))
855 (delete-all-but "." "common")
856 ;; Module name has been changed upstream.
857 (substitute* (find-files "." "\\.go$")
858 (("github.com/disiqueira/gotree")
859 "github.com/d6o/GoTree"))))))
860 (build-system go-build-system)
861 (arguments
862 (list
863 #:skip-build? #t
864 #:import-path "go.podman.io/common"
865 #:unpack-path "go.podman.io"
866 #:embed-files
867 #~(list "^VERSION$")
868 #:test-subdirs
869 ;; XXX: Remove when go-go-podman-io-image-v5 and go-go-podman-io-storage
870 ;; are updated.
871 #~(list "pkg/auth" "pkg/flag" "pkg/chown" "pkg/parse" "pkg/umask"
872 "pkg/report" "pkg/sysctl" "pkg/cgroups" "pkg/filters"
873 "pkg/formats" "pkg/machine" "pkg/seccomp" "pkg/secrets"
874 "pkg/sysinfo" "pkg/timetype" "pkg/manifests" "pkg/configmaps"
875 "pkg/hooks/0.1.0" "pkg/strongunits" "pkg/capabilities"
876 "pkg/subscriptions" "pkg/secrets/filedriver"
877 "pkg/configmaps/filedriver" "pkg/apparmor/internal/supported")))
878 (native-inputs
879 (list go-github-com-onsi-ginkgo-v2
880 go-github-com-davecgh-go-spew
881 go-github-com-onsi-gomega
882 go-github-com-spf13-cobra
883 go-github-com-spf13-pflag
884 go-github-com-stretchr-testify))
885 (propagated-inputs
886 (list go-github-com-checkpoint-restore-checkpointctl
887 go-github-com-checkpoint-restore-go-criu-v8
888 go-github-com-containerd-platforms
889 go-github-com-containers-ocicrypt
890 go-github-com-coreos-go-systemd-v22
891 go-github-com-cyphar-filepath-securejoin-0.4.1
892 go-github-com-davecgh-go-spew
893 go-github-com-d6o-gotree-v3 ;go-github-com-disiqueira-gotree-v3
894 go-github-com-docker-distribution
895 go-github-com-docker-go-units
896 go-github-com-fsnotify-fsnotify
897 go-github-com-godbus-dbus-v5
898 go-github-com-hashicorp-go-multierror
899 go-github-com-jinzhu-copier
900 go-github-com-json-iterator-go
901 go-github-com-moby-sys-capability
902 go-github-com-moby-sys-devices
903 go-github-com-opencontainers-cgroups
904 go-github-com-opencontainers-go-digest
905 go-github-com-opencontainers-image-spec
906 go-github-com-opencontainers-runtime-spec
907 go-github-com-opencontainers-runtime-tools
908 go-github-com-opencontainers-selinux
909 go-github-com-pkg-sftp
910 go-github-com-pmezard-go-difflib
911 go-github-com-seccomp-libseccomp-golang
912 go-github-com-sirupsen-logrus
913 go-github-com-skeema-knownhosts
914 go-github-com-vishvananda-netlink
915 go-go-etcd-io-bbolt
916 go-go-podman-io-image-v5
917 go-go-podman-io-storage
918 go-golang-org-x-crypto
919 go-golang-org-x-sync
920 go-golang-org-x-sys
921 go-golang-org-x-term
922 go-sigs-k8s-io-yaml
923 go-tags-cncf-io-container-device-interface))
924 (home-page "https://go.podman.io")
925 (synopsis "Go code and configuration used across containers projects")
926 (description
927 "This package provides shared common files and common Go code to manage
928those files in github.com/containers repos.")
929 (license license:asl2.0)))
930
931(define-public go-go-podman-io-image-v5
932 (package
933 (name "go-go-podman-io-image-v5")
934 (version "5.39.2")
935 (source
936 (origin
937 (method git-fetch)
938 (uri (git-reference
939 (url "https://github.com/podman-container-tools/container-libs")
940 (commit (go-version->git-ref version #:subdir "image"))))
941 (file-name (git-file-name name version))
942 (sha256
943 (base32 "17qjzgc3h89sa0y8qkviz5gry1kvkkm3j79yhn78c7gbmqcx5v0j"))
944 (modules '((guix build utils)
945 (ice-9 ftw)
946 (srfi srfi-26)))
947 (snippet
948 #~(begin
949 (define (delete-all-but directory . preserve)
950 (define (directory? x)
951 (and=> (stat x #f)
952 (compose (cut eq? 'directory <>) stat:type)))
953 (with-directory-excursion directory
954 (let* ((pred
955 (negate (cut member <> (append '("." "..") preserve))))
956 (items (scandir "." pred)))
957 (for-each (lambda (item)
958 (if (directory? item)
959 (delete-file-recursively item)
960 (delete-file item)))
961 items))))
962 (delete-all-but "." "image")
963 ;; This is a workaround to provide a correct import-path.
964 (rename-file "image" "tmp")
965 (mkdir-p "image/v5")
966 (copy-recursively "tmp" "image/v5")
967 (delete-file-recursively "tmp")))))
968 (build-system go-build-system)
969 (arguments
970 (list
971 #:skip-build? #t
972 #:import-path "go.podman.io/image/v5"
973 #:unpack-path "go.podman.io"
974 #:embed-files
975 #~(list "^VERSION$"
976 ;; For go-github-com-santhosh-tekuri-jsonschema-v6:
977 "applicator"
978 "content"
979 "core"
980 "format"
981 "format-annotation"
982 "format-assertion"
983 "meta-data"
984 "schema"
985 "unevaluated"
986 "validation")
987 #:test-flags
988 #~(list "-skip" (string-join
989 ;; Tests try to access local directories: /usr/share,
990 ;; /var/tmp; remote source https://quay.io/v2/,
991 ;; https://registry.suse.com/auth.
992 (list "TestComputeBlobInfo"
993 "TestCreateBigFileTemp"
994 "TestGPGSigningMechanismSign"
995 "TestMkDirBigFileTemp"
996 "TestReferenceNewImage"
997 "TestReferenceNewImageSource"
998 "TestReferencePolicyConfigurationNamespaces"
999 "TestSetCredentialsInteroperability"
1000 "TestSetupCertificates"
1001 "TestSign"
1002 "TestSignDockerManifest"
1003 "TestSignDockerManifestWithPassphrase"
1004 "TestSimpleSignerSignImageManifest"
1005 "TestSourcePrepareLayerData")
1006 "|"))
1007 #:phases
1008 #~(modify-phases %standard-phases
1009 (add-before 'check 'set-HOME
1010 (lambda _
1011 (setenv "HOME" "/tmp"))))))
1012 (native-inputs
1013 (list btrfs-progs
1014 eudev
1015 gnupg
1016 go-github-com-stretchr-testify
1017 gpgme
1018 libassuan))
1019 (propagated-inputs
1020 (list go-dario-cat-mergo
1021 go-github-com-burntsushi-toml
1022 go-github-com-containers-libtrust
1023 go-github-com-containers-ocicrypt
1024 go-github-com-cyberphone-json-canonicalization
1025 go-github-com-distribution-reference
1026 go-github-com-docker-cli
1027 go-github-com-docker-distribution
1028 go-github-com-docker-docker
1029 go-github-com-docker-docker-credential-helpers
1030 go-github-com-docker-go-connections
1031 go-github-com-hashicorp-go-cleanhttp
1032 go-github-com-hashicorp-go-retryablehttp
1033 go-github-com-klauspost-compress
1034 go-github-com-klauspost-pgzip
1035 go-github-com-manifoldco-promptui
1036 go-github-com-mattn-go-sqlite3
1037 go-github-com-opencontainers-go-digest
1038 go-github-com-opencontainers-image-spec
1039 go-github-com-proglottis-gpgme
1040 go-github-com-santhosh-tekuri-jsonschema-v6
1041 go-github-com-secure-systems-lab-go-securesystemslib
1042 go-github-com-sigstore-fulcio
1043 go-github-com-sigstore-sigstore
1044 go-github-com-sirupsen-logrus
1045 go-github-com-sylabs-sif-v2
1046 go-github-com-ulikunitz-xz
1047 go-github-com-vbauerster-mpb-v8
1048 go-go-etcd-io-bbolt
1049 go-go-podman-io-storage
1050 go-golang-org-x-crypto
1051 go-golang-org-x-oauth2
1052 go-golang-org-x-sync
1053 go-golang-org-x-term
1054 go-gopkg-in-yaml-v3))
1055 (home-page "https://go.podman.io")
1056 (synopsis "Go library to work in various way with containers' images")
1057 (description
1058 "@code{image} is a set of Go libraries aimed at working in various way
1059with containers' images and container image registries. The
1060@code{containers/image} library allows application to pull and push images
1061from container image registries, like the docker.io and quay.io registries. It
1062also implements \"simple image signing\". It's a successor of
1063@url{https://github.com/containers/image} project.")
1064 (license license:asl2.0)))
1065
1066(define-public go-go-podman-io-storage
1067 (package
1068 (name "go-go-podman-io-storage")
1069 (version "1.62.0")
1070 (source
1071 (origin
1072 (method git-fetch)
1073 (uri (git-reference
1074 (url "https://github.com/podman-container-tools/container-libs")
1075 (commit (go-version->git-ref version #:subdir "storage"))))
1076 (file-name (git-file-name name version))
1077 (sha256
1078 (base32 "0ywj80wkpyq2yhizsdlfh0n2fxip75042rsk7jm4vyp98bb18rb6"))
1079 (modules '((guix build utils)
1080 (ice-9 ftw)
1081 (srfi srfi-26)))
1082 (snippet
1083 #~(begin
1084 (define (delete-all-but directory . preserve)
1085 (define (directory? x)
1086 (and=> (stat x #f)
1087 (compose (cut eq? 'directory <>) stat:type)))
1088 (with-directory-excursion directory
1089 (let* ((pred
1090 (negate (cut member <> (append '("." "..") preserve))))
1091 (items (scandir "." pred)))
1092 (for-each (lambda (item)
1093 (if (directory? item)
1094 (delete-file-recursively item)
1095 (delete-file item)))
1096 items))))
1097 (delete-all-but "." "storage")))))
1098 (build-system go-build-system)
1099 (arguments
1100 (list
1101 #:import-path "go.podman.io/storage"
1102 #:unpack-path "go.podman.io"
1103 #:test-flags
1104 #~(list "-skip" (string-join
1105 ;; Root access is required.
1106 (list "TestAttachLoopbackDeviceRace"
1107 "TestChangesWithChangesGH13590"
1108 "TestChroot.*"
1109 "TestCopyDir"
1110 "TestCopyWithTarInexistentDestWillCreateIt"
1111 "TestEnsureRemoveAllWithMount"
1112 "TestLookupAdditionalLayerDecodeError"
1113 "TestLookupAdditionalLayerSuccess"
1114 "TestMkdir.*"
1115 "TestReplaceFileTarWrapper"
1116 "TestStoreDelete"
1117 "TestStoreMultiList"
1118 "TestSupportsShifting"
1119 "TestTarUntarWithXattr"
1120 "TestTarWithBlockCharFifo"
1121 "TestTarWithMaliciousSymlinks"
1122 "TestUnshareOOMScoreAdj"
1123 "TestUntarHardlinkToSymlink"
1124 "TestUntarPath"
1125 "TestUntarWithMaliciousSymlinks"
1126 "TestVfs.*")
1127 "|"))))
1128 (native-inputs
1129 (list go-github-com-stretchr-testify))
1130 (inputs
1131 (list btrfs-progs))
1132 (propagated-inputs
1133 (list go-github-com-burntsushi-toml
1134 go-github-com-containerd-stargz-snapshotter-estargz
1135 go-github-com-cyphar-filepath-securejoin-0.4.1
1136 go-github-com-docker-go-units
1137 go-github-com-google-go-intervals
1138 go-github-com-json-iterator-go
1139 go-github-com-klauspost-compress
1140 go-github-com-klauspost-pgzip
1141 go-github-com-mattn-go-shellwords
1142 go-github-com-mistifyio-go-zfs-v3
1143 go-github-com-moby-sys-capability
1144 go-github-com-moby-sys-mountinfo
1145 go-github-com-moby-sys-user
1146 go-github-com-opencontainers-go-digest
1147 go-github-com-opencontainers-runtime-spec
1148 go-github-com-opencontainers-selinux
1149 go-github-com-sirupsen-logrus
1150 go-github-com-tchap-go-patricia-v2
1151 go-github-com-ulikunitz-xz
1152 go-github-com-vbatts-tar-split
1153 go-golang-org-x-sync
1154 go-golang-org-x-sys
1155 go-gotest-tools-v3))
1156 (home-page "https://go.podman.io")
1157 (synopsis "Manage layer/image/container storage")
1158 (description
1159 "@code{storage} is a Go library which aims to provide methods for storing
1160filesystem layers, container images, and containers.")
1161 (license license:asl2.0)))
1162
1163;;;
1164;;; Executables:
1165;;;
1166
1167(define-public buildah
1168 (package
1169 (name "buildah")
1170 (version "1.44.1")
1171 (source
1172 (origin
1173 (method git-fetch)
1174 (uri (git-reference
1175 (url "https://github.com/containers/buildah")
1176 (commit (string-append "v" version))))
1177 (sha256
1178 (base32 "0ivy7i0pqzhpsnd38l9favi32vgm0xcsn5bg4cxxqg6yzgw0fshh"))
1179 (file-name (git-file-name name version))))
1180 (build-system gnu-build-system)
1181 (arguments
1182 (list
1183 #:make-flags
1184 #~(list (string-append "CC=" #$(cc-for-target))
1185 (string-append "PREFIX=" #$output)
1186 (string-append "GOMD2MAN=" #$go-md2man "/bin/go-md2man"))
1187 #:tests? #f ; /sys/fs/cgroup not set up in guix sandbox
1188 #:test-target "test-unit"
1189 #:phases
1190 #~(modify-phases %standard-phases
1191 (delete 'configure)
1192 (add-after 'unpack 'set-env
1193 (lambda _
1194 ;; When running go, things fail because HOME=/homeless-shelter.
1195 (setenv "HOME" "/tmp")))
1196 ;; Add -trimpath to build flags to avoid keeping references to go
1197 ;; packages.
1198 (add-after 'set-env 'patch-buildflags
1199 (lambda _
1200 (substitute* "Makefile"
1201 (("BUILDFLAGS :=") "BUILDFLAGS := -trimpath "))))
1202 (replace 'check
1203 (lambda* (#:key tests? #:allow-other-keys)
1204 (when tests?
1205 (invoke "make" "test-unit")
1206 (invoke "make" "test-conformance")
1207 (invoke "make" "test-integration"))))
1208 (add-after 'install 'symlink-helpers
1209 (lambda _
1210 (mkdir-p (string-append #$output "/_guix"))
1211 (for-each
1212 (lambda (what)
1213 (symlink (string-append (car what) "/bin/" (cdr what))
1214 (string-append #$output "/_guix/" (cdr what))))
1215 ;; Only tools that cannot be discovered via $PATH are
1216 ;; symlinked. Rest is handled in the 'wrap-buildah phase.
1217 `((#$aardvark-dns . "aardvark-dns")
1218 (#$netavark . "netavark")))))
1219 (add-after 'install 'wrap-buildah
1220 (lambda _
1221 (wrap-program (string-append #$output "/bin/buildah")
1222 `("CONTAINERS_HELPER_BINARY_DIR" =
1223 (,(string-append #$output "/_guix")))
1224 `("PATH" suffix
1225 (,(string-append #$crun "/bin")
1226 ,(string-append #$gcc "/bin") ; cpp
1227 ,(string-append #$passt "/bin")
1228 "/run/privileged/bin")))))
1229 (add-after 'install 'install-completions
1230 (lambda _
1231 (invoke "make" "install.completions"
1232 (string-append "PREFIX=" #$output)))))))
1233 (inputs (list bash-minimal
1234 btrfs-progs
1235 eudev
1236 glib
1237 gpgme
1238 libassuan
1239 libseccomp
1240 lvm2))
1241 (native-inputs
1242 (list bats
1243 go
1244 go-md2man
1245 pkg-config))
1246 (synopsis "Build @acronym{OCI, Open Container Initiative} images")
1247 (description
1248 "Buildah is a command-line tool to build @acronym{OCI, Open Container
1249Initiative} container images. More generally, it can be used to:
1250
1251@itemize
1252@item
1253create a working container, either from scratch or using an image as a
1254starting point;
1255@item
1256create an image, either from a working container or via the instructions
1257in a @file{Dockerfile};
1258@item
1259mount a working container's root filesystem for manipulation;
1260@item
1261use the updated contents of a container's root filesystem as a filesystem
1262layer to create a new image.
1263@end itemize")
1264 (home-page "https://buildah.io")
1265 (license license:asl2.0)))
1266
1267(define-public catatonit
1268 (package
1269 (name "catatonit")
1270 (version "0.2.1")
1271 (source
1272 (origin
1273 (method git-fetch)
1274 (uri (git-reference
1275 (url "https://github.com/openSUSE/catatonit/")
1276 (commit (string-append "v" version))))
1277 (file-name (git-file-name name version))
1278 (sha256
1279 (base32 "14vh0xpg6lzmh7r52vi9w1qfc14r7cfhfrbca7q5fg62d3hx7kxi"))))
1280 (build-system gnu-build-system)
1281 (native-inputs
1282 (list autoconf automake libtool))
1283 (home-page "https://github.com/openSUSE/catatonit")
1284 (synopsis "Container init")
1285 (description
1286 "Catatonit is a simple container init tool developed as a rewrite of
1287@url{https://github.com/cyphar/initrs, initrs} in C due to the need for static
1288compilation of Rust binaries with @code{musl}. Inspired by other container
1289inits like @url{https://github.com/krallin/tini, tini} and
1290@url{https://github.com/Yelp/dumb-init, dumb-init}, catatonit focuses on
1291correct signal handling, utilizing @code{signalfd(2)} for improved stability.
1292Its main purpose is to support the key usage by @code{docker-init}:
1293@code{/dev/init} – <your program>, with minimal additional features planned.")
1294 (license license:gpl2+)))
1295
1296(define-public checkpointctl
1297 (package/inherit go-github-com-checkpoint-restore-checkpointctl
1298 (name "checkpointctl")
1299 (arguments
1300 (substitute-keyword-arguments
1301 (package-arguments go-github-com-checkpoint-restore-checkpointctl)
1302 ((#:build-flags _) #~(list (string-append "-X main.version="
1303 #$version)))
1304 ((#:install-source? _ #t) #f)
1305 ((#:skip-build? _ #t) #f)
1306 ((#:tests? _ #t) #f)))
1307 (native-inputs
1308 (append
1309 (package-native-inputs go-github-com-checkpoint-restore-checkpointctl)
1310 (package-propagated-inputs go-github-com-checkpoint-restore-checkpointctl)))
1311 (propagated-inputs '())
1312 (inputs '())
1313 (description
1314 "This package provides a tool to read and manipulate checkpoint archives
1315as created by Podman, CRI-O and containerd.")))
1316
1317(define-public cni-plugins
1318 (package
1319 (name "cni-plugins")
1320 (version "1.9.1")
1321 (source
1322 (origin
1323 (method git-fetch)
1324 (uri (git-reference
1325 (url "https://github.com/containernetworking/plugins")
1326 (commit (string-append "v" version))))
1327 (file-name (git-file-name name version))
1328 (sha256
1329 (base32 "12z6w2jk6xgfiwdxys7skpkxldz1cgaa7scgfcr90lsghay59s6w"))
1330 (snippet
1331 #~(begin (use-modules (guix build utils))
1332 (delete-file-recursively "vendor")))))
1333 (build-system go-build-system)
1334 (arguments
1335 (list
1336 #:install-source? #f
1337 ;; XXX: Tests require root access, see test_linux.sh.
1338 #:tests? #f
1339 #:import-path "github.com/containernetworking/plugins/plugins/..."
1340 #:unpack-path "github.com/containernetworking/plugins"))
1341 (native-inputs
1342 (list go-github-com-alexflint-go-filemutex
1343 go-github-com-buger-jsonparser
1344 go-github-com-containernetworking-cni
1345 go-github-com-coreos-go-iptables
1346 go-github-com-coreos-go-systemd-v22
1347 go-github-com-godbus-dbus-v5
1348 go-github-com-insomniacslk-dhcp
1349 go-github-com-mattn-go-shellwords
1350 ;; go-github-com-microsoft-hcsshim
1351 go-github-com-networkplumbing-go-nft
1352 go-github-com-onsi-ginkgo-v2
1353 go-github-com-onsi-gomega
1354 go-github-com-opencontainers-selinux
1355 go-github-com-pkg-errors
1356 go-github-com-safchain-ethtool
1357 go-github-com-vishvananda-netlink
1358 go-github-com-vishvananda-netns
1359 go-golang-org-x-sys
1360 go-sigs-k8s-io-knftables
1361 util-linux))
1362 (home-page "https://github.com/containernetworking/plugins")
1363 (synopsis "Container Network Interface (CNI) network plugins")
1364 (description
1365 "This package provides Container Network Interface (CNI) plugins to
1366configure network interfaces in Linux containers.")
1367 (license license:asl2.0)))
1368
1369(define-public crun
1370 (package
1371 (name "crun")
1372 (version "1.29.1")
1373 (source
1374 (origin
1375 (method git-fetch)
1376 (uri (git-reference
1377 (url "https://github.com/containers/crun")
1378 (commit version)
1379 (recursive? #t)))
1380 (sha256
1381 (base32
1382 "02dlw47mydpwridbaqgdwm0l6wl54qngqbg9526ib6hcj347mj96"))
1383 (file-name (git-file-name name version))))
1384 (build-system gnu-build-system)
1385 (arguments
1386 (list
1387 #:configure-flags #~(list "--disable-systemd")
1388 #:tests? #f ; XXX: needs /sys/fs/cgroup mounted
1389 #:phases
1390 #~(modify-phases %standard-phases
1391 (add-after 'unpack 'git-version-h
1392 (lambda _
1393 (call-with-output-file "git-version.h"
1394 (lambda (port)
1395 (format
1396 port
1397 "#ifndef GIT_VERSION\n# define GIT_VERSION ~s\n#endif"
1398 #$version)))))
1399 (add-after 'unpack 'fix-tests
1400 (lambda _
1401 (substitute* (find-files "tests" "\\.(c|py)")
1402 (("/bin/true") (which "true"))
1403 (("/bin/false") (which "false"))
1404 ;; relies on sd_notify which requires systemd?
1405 (("\"sd-notify\" : test_sd_notify,") "")
1406 (("\"sd-notify-file\" : test_sd_notify_file,") "")))))))
1407 (inputs
1408 (list json-c
1409 libcap
1410 libseccomp
1411 yajl))
1412 (native-inputs
1413 (list automake
1414 autoconf
1415 git-minimal/pinned
1416 libtool
1417 pkg-config
1418 python-minimal-wrapper))
1419 (home-page "https://github.com/containers/crun")
1420 (synopsis "Open Container Initiative (OCI) Container runtime")
1421 (description
1422 "crun is a fast and low-memory footprint Open Container Initiative (OCI)
1423Container Runtime fully written in C.")
1424 (license license:gpl2+)))
1425
1426(define-public conmon
1427 (package
1428 (name "conmon")
1429 (version "2.2.1")
1430 (source
1431 (origin
1432 (method git-fetch)
1433 (uri (git-reference
1434 (url "https://github.com/containers/conmon")
1435 (commit (string-append "v" version))))
1436 (sha256
1437 (base32 "0n9l6030ibhk7pmsq85rarcf9b0kzglxibd1xnb6vzmkz3ywg1il"))
1438 (file-name (git-file-name name version))))
1439 (build-system gnu-build-system)
1440 (arguments
1441 (list #:make-flags
1442 #~(list (string-append "CC=" #$(cc-for-target))
1443 (string-append "PREFIX=" #$output))
1444 #:test-target "test"
1445 #:phases
1446 #~(modify-phases %standard-phases
1447 (delete 'configure)
1448 (add-before 'check 'prepare-tests
1449 (lambda* (#:key inputs #:allow-other-keys)
1450 (setenv "RUNTIME_BINARY"
1451 (search-input-file inputs "sbin/runc"))
1452
1453 ;; We need to skip all tests requiring journald.
1454 (for-each
1455 (lambda (test file)
1456 (substitute* file
1457 (((string-append "@test \"" test "\" \\{\n$") all)
1458 (string-append all "skip 'no journald in Guix';"))))
1459 '("log driver as journald should pass"
1460 "log driver as journald with short cid should fail"
1461 "multiple log drivers should pass"
1462 "log management: should work with multiple log drivers")
1463 '("test/01-basic.bats"
1464 "test/01-basic.bats"
1465 "test/01-basic.bats"
1466 "test/06-log-management.bats")))))))
1467 (inputs
1468 (list crun
1469 glib
1470 libseccomp))
1471 (native-inputs
1472 (list bats
1473 git
1474 go-md2man
1475 pkg-config
1476 socat
1477 runc))
1478 (home-page "https://github.com/containers/conmon")
1479 (synopsis "Monitoring tool for Open Container Initiative (OCI) runtime")
1480 (description
1481 "Conmon is a monitoring program and communication tool between a container
1482manager (like Podman or CRI-O) and an Open Container Initiative (OCI)
1483runtime (like runc or crun) for a single container.")
1484 (license license:asl2.0)))
1485
1486(define-public distrobox
1487 (package
1488 (name "distrobox")
1489 (version "1.8.2.4")
1490 (source
1491 (origin
1492 (method git-fetch)
1493 (uri (git-reference
1494 (url "https://github.com/89luca89/distrobox")
1495 (commit version)))
1496 (sha256
1497 (base32 "07kqgr5diwvkks3fn1r0nnpfqq6gngqyx4x7lxs06ri6g0a4knvf"))
1498 (file-name (git-file-name name version))))
1499 (build-system copy-build-system)
1500 (arguments
1501 (list #:phases
1502 #~(modify-phases %standard-phases
1503 ;; This script creates desktop files but when the store path for
1504 ;; distrobox changes it leaves the stale path on the desktop
1505 ;; file, so remove the path to use the profile's current
1506 ;; distrobox.
1507 (add-after 'unpack 'patch-distrobox-generate-entry
1508 (lambda _
1509 (substitute* "distrobox-generate-entry"
1510 (("\\$\\{distrobox_path\\}/distrobox") "distrobox"))))
1511 ;; Use WRAP-SCRIPT to wrap all of the scripts of distrobox,
1512 ;; excluding the host side ones.
1513 (add-after 'install 'wrap-scripts
1514 (lambda _
1515 (let ((path (search-path-as-list
1516 (list "bin")
1517 (list #$(this-package-input "podman")
1518 #$(this-package-input "wget")))))
1519 (for-each (lambda (script)
1520 (wrap-script
1521 (string-append #$output "/bin/distrobox-"
1522 script)
1523 `("PATH" ":" prefix ,path)))
1524 '("assemble"
1525 "create"
1526 "enter"
1527 "ephemeral"
1528 "generate-entry"
1529 "list"
1530 "rm"
1531 "stop"
1532 "upgrade")))))
1533 ;; These scripts are used in the container side and the
1534 ;; /gnu/store path is not shared with the containers.
1535 (add-after 'patch-shebangs 'unpatch-shebangs
1536 (lambda _
1537 (for-each (lambda (script)
1538 (substitute*
1539 (string-append #$output "/bin/distrobox-"
1540 script)
1541 (("#!.*/bin/sh") "#!/bin/sh\n")))
1542 '("export" "host-exec" "init"))))
1543 (replace 'install
1544 (lambda _
1545 (invoke "./install" "--prefix" #$output))))))
1546 (inputs
1547 (list guile-3.0 ; for wrap-script
1548 podman
1549 wget))
1550 (home-page "https://distrobox.it")
1551 (synopsis "Create and start containers highly integrated with the hosts")
1552 (description
1553 "Distrobox is a fancy wrapper around Podman or Docker to create and start
1554containers highly integrated with the hosts.")
1555 (license license:gpl3)))
1556
1557(define-public dive
1558 (package
1559 (name "dive")
1560 (version "0.12.0") ;newer version needs docker/docker@28+
1561 (source
1562 (origin
1563 (method git-fetch)
1564 (uri (git-reference
1565 (url "https://github.com/wagoodman/dive")
1566 (commit (string-append "v" version))))
1567 (file-name (git-file-name name version))
1568 (sha256
1569 (base32 "0p60bq0lc820p7x3nq8kxc8cx646c0z7zxqc7vav77zc4qbm3r8a"))))
1570 (build-system go-build-system)
1571 (arguments
1572 (list
1573 #:install-source? #f
1574 #:build-flags
1575 #~(list (string-append "-ldflags=-X main.version=" #$version))
1576 #:import-path "github.com/wagoodman/dive"
1577 #:test-flags #~(list "-vet=off")))
1578 (native-inputs
1579 (list go-github-com-awesome-gocui-gocui
1580 go-github-com-awesome-gocui-keybinding
1581 go-github-com-cespare-xxhash
1582 go-github-com-docker-cli
1583 go-github-com-docker-docker
1584 go-github-com-dustin-go-humanize
1585 go-github-com-fatih-color
1586 go-github-com-google-uuid
1587 go-github-com-logrusorgru-aurora
1588 go-github-com-lunixbochs-vtclean
1589 go-github-com-mitchellh-go-homedir
1590 go-github-com-phayes-permbits
1591 go-github-com-sergi-go-diff
1592 go-github-com-sirupsen-logrus
1593 go-github-com-spf13-afero
1594 go-github-com-spf13-cobra
1595 go-github-com-spf13-viper
1596 go-golang-org-x-net))
1597 (home-page "https://github.com/wagoodman/dive")
1598 (synopsis "Tool for exploring each layer in a docker image")
1599 (description
1600 "This package provides a tool for exploring a Docker image, layer
1601contents, and discovering ways to shrink the size of Docker/OCI image.")
1602 (license license:expat)))
1603
1604(define-public guix-compose
1605 (package
1606 (name "guix-compose")
1607 (version "0.2.0")
1608 (source
1609 (origin
1610 (method git-fetch)
1611 (uri (git-reference
1612 (url "https://codeberg.org/fishinthecalculator/guix-compose")
1613 (commit version)))
1614 (file-name (git-file-name name version))
1615 (sha256
1616 (base32 "1dy48qkz3ifxagijpvwg7rmq7hz3pikhdcfral6djyc9ppmz8mbm"))))
1617 (build-system guile-build-system)
1618 (arguments
1619 (list
1620 #:source-directory "src"
1621 #:phases
1622 #~(modify-phases %standard-phases
1623 (add-after 'unpack 'set-load-paths-in-entry-point
1624 (lambda _
1625 (define load-path
1626 (cons (string-append #$output "/share/guile/site/3.0")
1627 (parse-path (getenv "GUILE_LOAD_PATH"))))
1628 (define load-compiled-path
1629 (cons (string-append #$output "/lib/guile/3.0/site-ccache")
1630 (parse-path (getenv "GUILE_LOAD_COMPILED_PATH"))))
1631 (define search-paths-header
1632 `(begin
1633 (set! %load-path
1634 (append (list ,@load-path) %load-path))
1635 (set! %load-compiled-path
1636 (append (list ,@load-compiled-path)
1637 %load-compiled-path))))
1638
1639 (substitute* "src/guix/extensions/compose.scm"
1640 ((";;@load-paths@")
1641 (with-output-to-string
1642 (lambda () (write search-paths-header)))))))
1643 (add-after 'build 'add-extension-to-search-path
1644 (lambda _
1645 (with-directory-excursion #$output
1646 (mkdir-p "share/guix/extensions")
1647 (symlink
1648 (string-append
1649 #$output "/share/guile/site/3.0/guix/extensions/compose.scm")
1650 "share/guix/extensions/compose.scm"))))
1651 (add-after 'add-extension-to-search-path 'check
1652 (lambda* (#:key tests? #:allow-other-keys)
1653 (when tests?
1654 (invoke
1655 "guile" "-L" "./modules" "-s" "tests/test-compose.scm")))))))
1656 (native-inputs (list guile-3.0))
1657 ;; Avoid setting propagated so that we use the user’s profile.
1658 (inputs (list guix guile-dotenv guile-yamlpp))
1659 (synopsis "Guix' docker compose compatibility layer")
1660 (description "A toolkit to run, read and write docker-compose.yml files with
1661Guix machinery.")
1662 (home-page "https://codeberg.org/fishinthecalculator/guix-compose")
1663 (license license:gpl3+)))
1664
1665(define-public gvisor-tap-vsock
1666 (package/inherit go-github-com-containers-gvisor-tap-vsock
1667 (name "gvisor-tap-vsock")
1668 (arguments
1669 (substitute-keyword-arguments arguments
1670 ((#:install-source? _ #t) #f)
1671 ((#:skip-build? _ #t) #f)
1672 ((#:tests? _ #t) #f)
1673 ((#:phases _ '%standard-phases)
1674 #~(modify-phases %standard-phases
1675 ;; Build binary outputs are taken from project's Makefile.
1676 (replace 'build
1677 (lambda arguments
1678 (for-each
1679 (lambda (cmd)
1680 (apply (assoc-ref %standard-phases 'build)
1681 `(,@arguments #:import-path ,cmd)))
1682 (list "github.com/containers/gvisor-tap-vsock/cmd/gvproxy"
1683 "github.com/containers/gvisor-tap-vsock/cmd/qemu-wrapper"
1684 "github.com/containers/gvisor-tap-vsock/cmd/vm"))))
1685 (add-after 'install 'fix-bin-name
1686 (lambda _
1687 (rename-file (string-append #$output "/bin/vm")
1688 (string-append #$output "/bin/gvforwarder"))))))))
1689 (native-inputs
1690 (package-propagated-inputs go-github-com-containers-gvisor-tap-vsock))
1691 (propagated-inputs '())
1692 (inputs '())))
1693
1694(define-public libslirp
1695 (package
1696 (name "libslirp")
1697 (version "4.9.4")
1698 (source
1699 (origin
1700 (method git-fetch)
1701 (uri (git-reference
1702 (url "https://gitlab.freedesktop.org/slirp/libslirp")
1703 (commit (string-append "v" version))))
1704 (sha256
1705 (base32 "19f1p37b4ybqbgk817g3sqhdvr1gl3d1063hj7zg1jqa301s2afw"))
1706 (file-name (git-file-name name version))))
1707 (build-system meson-build-system)
1708 (propagated-inputs
1709 ;; In Requires of slirp.pc.
1710 (list glib))
1711 (native-inputs
1712 (list pkg-config))
1713 (home-page "https://gitlab.freedesktop.org/slirp/libslirp")
1714 (synopsis "User-mode networking library")
1715 (description
1716 "libslirp is a user-mode networking library used by virtual machines,
1717containers or various tools.")
1718 (license license:bsd-3)))
1719
1720(define-public runc
1721 ;; TODO: Inheerit form go-github-com-opencontainers-runc when it's moved
1722 ;; here.
1723 (package
1724 (name "runc")
1725 (version "1.3.0")
1726 (source
1727 (origin
1728 (method git-fetch)
1729 (uri (git-reference
1730 (url "https://github.com/opencontainers/runc")
1731 (commit (string-append "v" version))))
1732 (file-name (git-file-name name version))
1733 (sha256
1734 (base32 "0midvxwmj4fvhy5mqv616bhlx39j0gd6y890adx7dnz5in506ym1"))
1735 (snippet
1736 #~(begin
1737 (use-modules (guix build utils))
1738 (delete-file-recursively "vendor")))))
1739 (build-system go-build-system)
1740 (arguments
1741 (list
1742 ;; XXX: 20/139 tests fail due to missing /var, cgroups and apparmor in
1743 ;; the build environment.
1744 #:tests? #f
1745 #:install-source? #f
1746 #:import-path "github.com/opencontainers/runc"
1747 #:phases
1748 #~(modify-phases %standard-phases
1749 (add-after 'unpack 'patch-source
1750 (lambda* (#:key import-path #:allow-other-keys)
1751 (substitute* (string-append "src/" import-path "/Makefile")
1752 (("/bin/bash") (which "bash")))))
1753 (replace 'build
1754 (lambda* (#:key import-path #:allow-other-keys)
1755 (with-directory-excursion (string-append "src/" import-path)
1756 (invoke "make" "all" "man"))))
1757 (replace 'install
1758 (lambda* (#:key import-path outputs #:allow-other-keys)
1759 (with-directory-excursion (string-append "src/" import-path)
1760 (invoke "make" "install" "install-bash" "install-man"
1761 (string-append "PREFIX=" #$output))))))))
1762 (native-inputs
1763 (list go-github-com-checkpoint-restore-go-criu-v6
1764 go-github-com-containerd-console
1765 go-github-com-coreos-go-systemd-v22
1766 go-github-com-cyphar-filepath-securejoin-0.4.1
1767 go-github-com-docker-go-units
1768 go-github-com-godbus-dbus-v5
1769 go-github-com-moby-sys-capability
1770 go-github-com-moby-sys-mountinfo
1771 go-github-com-moby-sys-user
1772 go-github-com-moby-sys-userns
1773 go-github-com-mrunalp-fileutils
1774 go-github-com-opencontainers-cgroups-0.0.1
1775 go-github-com-opencontainers-runtime-spec-1.2.1
1776 go-github-com-opencontainers-selinux
1777 go-github-com-seccomp-libseccomp-golang
1778 go-github-com-sirupsen-logrus
1779 go-github-com-urfave-cli
1780 go-github-com-vishvananda-netlink
1781 go-golang-org-x-net
1782 go-golang-org-x-sys
1783 go-google-golang-org-protobuf
1784 go-md2man
1785 pkg-config))
1786 (inputs
1787 (list libseccomp))
1788 (synopsis "Open container initiative runtime")
1789 (home-page "https://opencontainers.org/")
1790 (description
1791 "@command{runc} is a command line client for running applications
1792packaged according to the
1793@uref{https://github.com/opencontainers/runtime-spec/blob/master/spec.md, Open
1794Container Initiative (OCI) format} and is a compliant implementation of the
1795Open Container Initiative specification.")
1796 (license license:asl2.0)))
1797
1798(define-public skopeo
1799 (package
1800 (name "skopeo")
1801 (version "1.24.0")
1802 (source (origin
1803 (method git-fetch)
1804 (uri (git-reference
1805 (url "https://github.com/podman-container-tools/skopeo")
1806 (commit (string-append "v" version))))
1807 (file-name (git-file-name name version))
1808 (sha256
1809 (base32
1810 "05a2xp3ss59nld8i4zf85rqrqlsid1ipj5484vp23a5sdiybl0j4"))))
1811 (build-system gnu-build-system)
1812 (native-inputs
1813 (list go
1814 go-md2man
1815 pkg-config))
1816 (inputs
1817 (list bash-minimal
1818 btrfs-progs
1819 eudev
1820 libassuan
1821 libselinux
1822 libostree
1823 lvm2
1824 glib
1825 gpgme))
1826 (arguments
1827 (list
1828 #:make-flags
1829 #~(list (string-append "CC=" #$(cc-for-target))
1830 "PREFIX="
1831 (string-append "DESTDIR=" #$output)
1832 "GOGCFLAGS=-trimpath"
1833 (string-append "GOMD2MAN=" #$go-md2man "/bin/go-md2man"))
1834 #:tests? #f ; The tests require Docker
1835 #:test-target "test-unit"
1836 #:imported-modules
1837 (source-module-closure `(,@%default-gnu-imported-modules
1838 (guix build go-build-system)))
1839 #:phases
1840 #~(modify-phases %standard-phases
1841 (delete 'configure)
1842 (add-after 'unpack 'set-env
1843 (lambda _
1844 ;; When running go, things fail because HOME=/homeless-shelter.
1845 (setenv "HOME" "/tmp")
1846 ;; Required for detecting btrfs in hack/btrfs* due to bug in GNU
1847 ;; Make <4.4 causing CC not to be propagated into $(shell ...)
1848 ;; calls. Can be removed once we update to >4.3.
1849 (setenv "CC" #$(cc-for-target))))
1850 (add-after 'install 'wrap-skopeo
1851 (lambda _
1852 (wrap-program (string-append #$output "/bin/skopeo")
1853 `("PATH" suffix
1854 ;; We need at least newuidmap, newgidmap and mount.
1855 ("/run/privileged/bin"))))))))
1856 (home-page "https://github.com/podman-container-tools/skopeo")
1857 (synopsis "Interact with container images and container image registries")
1858 (description
1859 "@command{skopeo} is a command line utility providing various operations
1860with container images and container image registries. It can:
1861@enumerate
1862
1863@item Copy container images between various containers image stores,
1864converting them as necessary.
1865
1866@item Convert a Docker schema 2 or schema 1 container image to an OCI image.
1867
1868@item Inspect a repository on a container registry without needlessly pulling
1869the image.
1870
1871@item Sign and verify container images.
1872
1873@item Delete container images from a remote container registry.
1874
1875@end enumerate")
1876 (license license:asl2.0)))
1877
1878(define-public slirp4netns
1879 (package
1880 (name "slirp4netns")
1881 (version "1.3.3")
1882 (source
1883 (origin
1884 (method git-fetch)
1885 (uri (git-reference
1886 (url "https://github.com/rootless-containers/slirp4netns")
1887 (commit (string-append "v" version))))
1888 (sha256
1889 (base32 "165z1ccsb8w901965rlzcrbln17l1jdg9k7vsiamlx0q06v24b96"))
1890 (file-name (git-file-name name version))))
1891 (build-system gnu-build-system)
1892 (arguments
1893 '(#:tests? #f ; XXX: open("/dev/net/tun"): No such file or directory
1894 #:phases (modify-phases %standard-phases
1895 (add-after 'unpack 'fix-hardcoded-paths
1896 (lambda _
1897 (substitute* (find-files "tests" "\\.sh")
1898 (("ping") "/run/privileged/bin/ping")))))))
1899 (inputs
1900 (list glib
1901 libcap
1902 libseccomp
1903 libslirp))
1904 (native-inputs
1905 (list automake
1906 autoconf
1907 iproute ; iproute, jq, nmap (ncat) and util-linux are for tests
1908 jq
1909 nmap
1910 pkg-config
1911 util-linux))
1912 (home-page "https://github.com/rootless-containers/slirp4netns")
1913 (synopsis "User-mode networking for unprivileged network namespaces")
1914 (description
1915 "slirp4netns provides user-mode networking (\"slirp\") for unprivileged
1916network namespaces.")
1917 (license license:gpl2+)))
1918
1919(define-public passt
1920 (package
1921 (name "passt")
1922 (version "2024_12_11.09478d5")
1923 (source
1924 (origin
1925 (method url-fetch)
1926 (uri (string-append "https://passt.top/passt/snapshot/passt-" version
1927 ".tar.gz"))
1928 (sha256
1929 (base32 "1arkir4784chw9x37174rc12cp353501m43p6iwvk5mqrlq02k90"))))
1930 (build-system gnu-build-system)
1931 (arguments
1932 (list
1933 #:make-flags
1934 #~(list (string-append "CC=" #$(cc-for-target))
1935 "RLIMIT_STACK_VAL=1024" ; ¯\_ (ツ)_/¯
1936 (string-append "VERSION=" #$version)
1937 (string-append "prefix=" #$output))
1938 #:tests? #f
1939 #:phases
1940 #~(modify-phases %standard-phases
1941 (delete 'configure))))
1942 (home-page "https://passt.top")
1943 (synopsis "Plug A Simple Socket Transport")
1944 (description
1945 "passt implements a thin layer between guest and host, that only
1946implements what's strictly needed to pretend processes are running locally.
1947The TCP adaptation doesn't keep per-connection packet buffers, and reflects
1948observed sending windows and acknowledgements between the two sides. This TCP
1949adaptation is needed as passt runs without the CAP_NET_RAW capability: it
1950can't create raw IP sockets on the pod, and therefore needs to map packets at
1951Layer-2 to Layer-4 sockets offered by the host kernel.
1952
1953Also provides pasta, which similarly to slirp4netns, provides networking to
1954containers by creating a tap interface available to processes in the
1955namespace, and mapping network traffic outside the namespace using native
1956Layer-4 sockets.")
1957 (license (list license:gpl2+ license:bsd-3))))
1958
1959(define-public podman
1960 (package
1961 (name "podman")
1962 (version "6.1.1")
1963 (outputs '("out" "docker"))
1964 (properties
1965 `((output-synopsis "docker" "docker alias for podman")))
1966 (source
1967 (origin
1968 (method git-fetch)
1969 (uri (git-reference
1970 (url "https://github.com/podman-container-tools/podman")
1971 (commit (string-append "v" version))))
1972 (sha256
1973 (base32 "0zy9kmsi06q8iqnqq7xhsyhrljksjlggsk0vhlral7jf92ll10vc"))
1974 (file-name (git-file-name name version))))
1975 (build-system gnu-build-system)
1976 (arguments
1977 (list
1978 #:make-flags
1979 #~(list (string-append "CC=" #$(cc-for-target))
1980 (string-append "PREFIX=" #$output)
1981 (string-append "HELPER_BINARIES_DIR=" #$output "/_guix")
1982 (string-append "GOMD2MAN=" #$go-md2man "/bin/go-md2man")
1983 (string-append "BUILDFLAGS=-trimpath"))
1984 #:tests? #f ; /sys/fs/cgroup not set up in guix sandbox
1985 #:test-target "test"
1986 #:phases
1987 #~(modify-phases %standard-phases
1988 (delete 'configure)
1989 (add-after 'unpack 'set-env
1990 (lambda _
1991 ;; When running go, things fail because HOME=/homeless-shelter.
1992 (setenv "HOME" "/tmp")))
1993 (replace 'check
1994 (lambda* (#:key tests? #:allow-other-keys)
1995 (when tests?
1996 (invoke "make" "localsystem")
1997 (invoke "make" "remotesystem"))))
1998 (add-after 'unpack 'fix-hardcoded-paths
1999 (lambda _
2000 (substitute* "vendor/go.podman.io/common/pkg/config/config_linux.go"
2001 (("/usr/local/libexec/podman")
2002 (string-append #$output "/libexec/podman"))
2003 (("/usr/local/lib/podman")
2004 (string-append #$output "/bin")))))
2005 (add-after 'install 'symlink-helpers
2006 (lambda _
2007 (mkdir-p (string-append #$output "/_guix"))
2008 (for-each
2009 (lambda (what)
2010 (symlink (string-append (car what) "/bin/" (cdr what))
2011 (string-append #$output "/_guix/" (cdr what))))
2012 ;; Only tools that cannot be discovered via $PATH are
2013 ;; symlinked. Rest is handled in the 'wrap-podman phase.
2014 `((#$aardvark-dns . "aardvark-dns")
2015 ;; Required for podman-machine, which is *not* supported out
2016 ;; of the box. But it cannot be discovered via $PATH, so
2017 ;; there is no other way for the user to install it. It
2018 ;; costs ~10MB, so let's leave it here.
2019 (#$gvisor-tap-vsock . "gvproxy")
2020 (#$netavark . "netavark")))))
2021 (add-after 'install 'wrap-podman
2022 (lambda _
2023 (wrap-program (string-append #$output "/bin/podman")
2024 `("PATH" suffix
2025 (,(string-append #$catatonit "/bin")
2026 ,(string-append #$conmon "/bin")
2027 ,(string-append #$crun "/bin")
2028 ,(string-append #$gcc "/bin") ; cpp
2029 ,(string-append #$iptables "/sbin")
2030 ,(string-append #$nftables "/sbin")
2031 ,(string-append #$passt "/bin")
2032 ,(string-append #$procps "/bin") ; ps
2033 "/run/privileged/bin")))))
2034 (add-after 'install 'install-docker
2035 (lambda _
2036 ;; So it picks podman of the other output.
2037 (substitute* "docker/docker.in"
2038 (("[$][{]BINDIR[}]") (string-append #$output "/bin"))
2039 (("[$][{]ETCDIR[}]") "/etc"))
2040 (invoke "make" "install.docker"
2041 (string-append "PREFIX=" #$output:docker)
2042 (string-append "ETCDIR=" #$output:docker "/etc"))))
2043 (add-after 'install 'install-completions
2044 (lambda _
2045 (invoke "make" "install.completions"
2046 (string-append "PREFIX=" #$output)))))))
2047 (inputs
2048 (list bash-minimal
2049 btrfs-progs
2050 gpgme
2051 libassuan
2052 libseccomp
2053 libselinux))
2054 (native-inputs
2055 (list grep
2056 bats
2057 git-minimal/pinned
2058 go
2059 go-md2man
2060 gettext-minimal ; for envsubst
2061 mandoc
2062 pkg-config
2063 python))
2064 (home-page "https://podman.io")
2065 (synopsis "Manage containers, images, pods, and their volumes")
2066 (description
2067 "Podman (the POD MANager) is a tool for managing containers and images,
2068volumes mounted into those containers, and pods made from groups of
2069containers.
2070
2071Not all commands are working out of the box due to requiring additional
2072binaries to be present in the $PATH.
2073
2074To get @code{podman compose} working, install either @code{podman-compose} or
2075@code{docker-compose} packages.
2076
2077To get @code{podman machine} working, install @code{qemu-minimal}, and
2078@code{openssh} packages.")
2079 (license license:asl2.0)))
2080
2081(define-public podman-compose
2082 (package
2083 (name "podman-compose")
2084 (version "1.6.0")
2085 (source
2086 (origin
2087 (method git-fetch)
2088 (uri (git-reference
2089 (url "https://github.com/containers/podman-compose")
2090 (commit (string-append "v" version))))
2091 (file-name (git-file-name name version))
2092 (sha256
2093 (base32 "0lp4s7j1dwrnl8r9k93kd0396jwy0rkyq545ca88d90nyrjwniff"))))
2094 (build-system pyproject-build-system)
2095 (arguments
2096 (list
2097 ;; Only run tests in `tests/unit`, skipping the ones in
2098 ;; `tests/integration`. The integration tests need an environment with
2099 ;; the ability to manage containers and volumes using the `podman`
2100 ;; command.
2101 ;;
2102 ;; tests: 378 tests
2103 #:test-backend #~'unittest
2104 #:test-flags #~(list "discover" "tests/unit")))
2105 (native-inputs
2106 (list python-parameterized
2107 python-setuptools))
2108 (propagated-inputs
2109 (list python-dotenv
2110 python-pyyaml))
2111 (home-page "https://github.com/containers/podman-compose")
2112 (synopsis "Script to run docker-compose.yml using podman")
2113 (description
2114 "This package provides an implementation of
2115@url{https://compose-spec.io/, Compose Spec} for @code{podman} focused on
2116being rootless and not requiring any daemon to be running.")
2117 (license license:gpl2)))
2118
2119(define-public podman-containers-storage
2120 (package/inherit go-go-podman-io-storage
2121 (name "podman-containers-storage")
2122 (arguments
2123 (substitute-keyword-arguments arguments
2124 ((#:import-path _ "") "go.podman.io/storage/cmd/...")
2125 ((#:install-source? #t #t) #f)
2126 ((#:tests? #t #t) #f)
2127 ((#:phases phases '%standard-phases)
2128 #~(modify-phases #$phases
2129 (add-after 'install 'build-and-install-docs
2130 (lambda* (#:key unpack-path #:allow-other-keys)
2131 (with-directory-excursion (string-append "src/" unpack-path
2132 "/storage")
2133 (setenv "PREFIX" #$output)
2134 (invoke "make" "-C" "docs" "docs" "install"))))))))
2135 (native-inputs
2136 (append
2137 (modify-inputs native-inputs
2138 (append go-md2man))
2139 (package-propagated-inputs go-go-podman-io-storage)))
2140 (propagated-inputs '())
2141 (description
2142 "@code{containers-storage} is a command line tool for manipulating local
2143layer/image/container stores.")))
2144
2145(define-public umoci
2146 (package
2147 (name "umoci")
2148 (version "0.6.0")
2149 (source
2150 (origin
2151 (method git-fetch)
2152 (uri (git-reference
2153 (url "https://github.com/opencontainers/umoci")
2154 (commit (string-append "v" version))))
2155 (file-name (git-file-name name version))
2156 (sha256
2157 (base32 "0m50x2q2h34g6sh786blf8r9wh098yzgwnicdlx0cgsqqwjsn0ia"))
2158 (snippet
2159 #~(begin
2160 (use-modules (guix build utils))
2161 (delete-file-recursively "vendor")))))
2162 (build-system go-build-system)
2163 (arguments
2164 (list
2165 #:install-source? #f
2166 #:import-path "github.com/opencontainers/umoci/cmd/umoci"
2167 #:unpack-path "github.com/opencontainers/umoci"
2168 #:test-flags
2169 ;; Two tests fail with error: unpack config.json: convert spec to
2170 ;; rootless: inspecting mount flags of /etc/resolv.conf: no such file or
2171 ;; directory
2172 #~(list "-skip" (string-append "TestUnpackManifestCustomLayer"
2173 "|TestUnpackStartFromDescriptor"))
2174 #:test-subdirs #~(list "../../...") ;test the whole library
2175 #:build-flags
2176 #~(list (string-append "-ldflags="
2177 "-X github.com/opencontainers/umoci.version="
2178 #$version))
2179 #:phases
2180 #~(modify-phases %standard-phases
2181 (add-after 'install 'build-and-install-man-pages
2182 (lambda* (#:key unpack-path #:allow-other-keys)
2183 (with-directory-excursion
2184 (string-append "src/" unpack-path "/doc/man")
2185 (mkdir-p (string-append #$output "/share/man/man1"))
2186 (for-each
2187 (lambda (file)
2188 (let* ((file (string-drop-right file 3)) ;cut .md
2189 (in-md (string-append file ".md"))
2190 (out-man (string-append #$output
2191 "/share/man/man1/" file)))
2192 (invoke "go-md2man" "-in" in-md "-out" out-man)))
2193 (find-files "." "\\.md$"))))))))
2194 (native-inputs
2195 (list go-github-com-adalogics-go-fuzz-headers
2196 go-github-com-apex-log
2197 go-github-com-blang-semver-v4
2198 go-github-com-containerd-platforms
2199 go-github-com-cyphar-filepath-securejoin-0.4.1
2200 go-github-com-cyphar-go-mtree
2201 go-github-com-docker-go-units
2202 go-github-com-klauspost-compress
2203 go-github-com-klauspost-pgzip
2204 go-github-com-moby-sys-user
2205 go-github-com-moby-sys-userns
2206 go-github-com-mohae-deepcopy
2207 go-github-com-opencontainers-go-digest
2208 go-github-com-opencontainers-image-spec
2209 go-github-com-opencontainers-runtime-spec
2210 go-github-com-rootless-containers-proto-go-proto
2211 go-github-com-stretchr-testify
2212 go-github-com-urfave-cli
2213 go-golang-org-x-sys
2214 go-google-golang-org-protobuf
2215 go-md2man))
2216 (home-page "https://umo.ci/")
2217 (synopsis "Tool for modifying Open Container images")
2218 (description
2219 "@command{umoci} is a tool that allows for high-level modification of an
2220Open Container Initiative (OCI) image layout and its tagged images.")
2221 (license license:asl2.0)))