3 nbdkit-cdi-plugin - export a layer from a container image
7 nbdkit cdi [name=]NAME[:TAG|@DIGEST] [layer=N]
11 C<nbdkit-cdi-plugin> (Containerized Data Importer plugin) is a plugin
12 for L<nbdkit(1)> which downloads a container image using
13 L<podman-pull(1)> and makes a single layer available over NBD. The
14 plugin is essentially a convenient wrapper around L<podman(1)> and
15 L<jq(1)> and requires both tools to be installed.
19 Given a Containerized Data Importer (CDI) registry image containing a
20 VM disk, you can export the whole layer using:
22 $ nbdkit cdi docker://kubevirt/fedora-cloud-container-disk-demo
24 The layer exported over NBD is a tar file:
26 $ nbdcopy nbd://localhost - | file -
29 To export only the VM disk image in this layer, combine this plugin
30 with L<nbdkit-tar-filter(1)>. In this example when you run L<file(1)>
31 on the tar entry within the layer it shows that it is a QCOW2 file:
33 $ nbdkit cdi docker://kubevirt/fedora-cloud-container-disk-demo \
34 --filter=tar tar-entry=./disk/downloaded \
35 --run 'nbdcopy "$uri" - | file -'
36 -: QEMU QCOW2 Image (v2), 4294967296 bytes
42 =item [B<name=>]NAME[:TAG|@DIGEST]
44 The name or URI of the container image. This is passed to
47 C<name=> is a magic config key and may be omitted in most cases.
48 See L<nbdkit(1)/Magic parameters>.
52 Export the N'th layer (instead of layer 0).
56 =head1 ENVIRONMENT VARIABLES
62 A temporary copy of the layer is created in C<TMPDIR>. If this
63 environment variable is not set then F</var/tmp> is used instead.
71 =item F<$plugindir/nbdkit-cdi-plugin.so>
75 Use C<nbdkit --dump-config> to find the location of C<$plugindir>.
81 C<nbdkit-cdi-plugin> first appeared in nbdkit 1.22.
87 L<nbdkit-tar-filter(1)>,
91 L<https://github.com/kubevirt/containerized-data-importer/blob/master/doc/image-from-registry.md>.