nbdkit-cdi-plugin(1) NBDKIT nbdkit-cdi-plugin(1) NAME nbdkit-cdi-plugin - export a layer from a container image SYNOPSIS nbdkit cdi [name=]NAME[:TAG|@DIGEST] [layer=N] DESCRIPTION "nbdkit-cdi-plugin" (Containerized Data Importer plugin) is a plugin for nbdkit(1) which downloads a container image using podman-pull(1) and makes a single layer available over NBD. The plugin is essentially a convenient wrapper around podman(1) and jq(1) and requires both tools to be installed. EXAMPLES Given a Containerized Data Importer (CDI) registry image containing a VM disk, you can export the whole layer using: $ nbdkit cdi quay.io/kubevirt/fedora-cloud-container-disk-demo The layer exported over NBD is a tar file: $ nbdcopy nbd://localhost - | file - -: POSIX tar archive To export only the VM disk image in this layer, combine this plugin with nbdkit-tar-filter(1). In the example below the file exposed inside the tar archive is a qcow2 image so you can turn it into a raw NBD export of the virtual machine using nbdkit-qcow2dec-filter(1): aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a fedora-cloud-container-disk-demo layer=0 a a (uncompressed tar file) a a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a a a ./disk/downloaded a a a a (qcow2 image) a a a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa a aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa $ nbdkit cdi \ --filter=qcow2dec \ --filter=tar tar-entry=./disk/downloaded \ quay.io/kubevirt/fedora-cloud-container-disk-demo \ --run 'nbdinfo "$uri"' export="": export-size: 4294967296 (4G) content: DOS/MBR boot sector [...] PARAMETERS [name=]NAME[:TAG|@DIGEST] The name or URI of the container image. This is passed to pod- man-pull(1). "name=" prefix may be omitted in most cases. See "Magic parameters" in nbdkit(1). layer=N Export the N'th layer (instead of layer 0). ENVIRONMENT VARIABLES "TMPDIR" A temporary copy of the layer is created in "TMPDIR". If this environ- ment variable is not set then /var/tmp is used instead. FILES $plugindir/nbdkit-cdi-plugin.so The plugin. Use "nbdkit --dump-config" to find the location of $plugindir. VERSION "nbdkit-cdi-plugin" first appeared in nbdkit 1.22. SEE ALSO nbdkit(1), nbdkit-plugin(3), nbdkit-qcow2dec-filter(1), nbdkit-tar-fil- ter(1), podman(1), podman-pull(1), jq(1), https://github.com/kubevirt/con- tainerized-data-importer/blob/master/doc/image-from-registry.md. AUTHORS Richard W.M. Jones COPYRIGHT Copyright Red Hat LICENSE Redistribution and use in source and binary forms, with or without modifi- cation, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright no- tice, this list of conditions and the following disclaimer in the docu- mentation and/or other materials provided with the distribution. * Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EX- PRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DIS- CLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DI- RECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SER- VICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABIL- ITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAM- AGE. nbdkit-1.46.2 2026-08-30 nbdkit-cdi-plugin(1)
NAME | SYNOPSIS | DESCRIPTION | EXAMPLES | PARAMETERS | ENVIRONMENT VARIABLES | FILES | VERSION | SEE ALSO | AUTHORS | COPYRIGHT | LICENSE
Want to link to this manual page? Use this URL:
<https://man.freebsd.org/cgi/man.cgi?query=nbdkit-cdi-plugin&sektion=1&manpath=FreeBSD+Ports+15.1.quarterly>
