| 1 |
.. _image_types: |
| 2 |
|
| 3 |
Image Types |
| 4 |
=========== |
| 5 |
|
| 6 |
.. note:: |
| 7 |
|
| 8 |
Before building an image with {kiwi}, it's important to understand |
| 9 |
the different image types and their meaning. This document provides |
| 10 |
an overview of the supported {kiwi} image types, their results, |
| 11 |
and some words about the environment to run the build. |
| 12 |
|
| 13 |
ISO Hybrid Live Image |
| 14 |
An ISO image that can be dumped on a CD/DVD or USB stick |
| 15 |
and boots from this media without interfering with other |
| 16 |
system storage components. A useful pocket system for testing, |
| 17 |
demo, and debugging purposes. For further details, refer |
| 18 |
to :ref:`hybrid_iso`. |
| 19 |
|
| 20 |
Virtual Disk Image |
| 21 |
An image representing the system disk, useful for cloud frameworks |
| 22 |
like Amazon EC2, Google Compute Engine, or Microsoft Azure. |
| 23 |
For further details, refer to :ref:`simple_disk`. |
| 24 |
|
| 25 |
OEM Expandable Disk Image |
| 26 |
An image representing an expandable system disk. This means after |
| 27 |
deployment, the system can resize itself to the new disk geometry. |
| 28 |
The resize operation is configurable as part of the image description, |
| 29 |
and an installation image for CD/DVD, USB stick, and network deployment |
| 30 |
can be created in addition. For further details, refer to: |
| 31 |
:ref:`expandable_disk`. |
| 32 |
|
| 33 |
Docker Container Image |
| 34 |
An archive image suitable for the Docker container engine. |
| 35 |
The image can be loaded via the `docker load` command and |
| 36 |
works within the scope of the container engine. |
| 37 |
For further details, refer to: :ref:`building_container_build`. |
| 38 |
|
| 39 |
WSL Container Image |
| 40 |
An archive image suitable for the Windows Subsystem for Linux |
| 41 |
container engine. The image can be loaded from a Windows System |
| 42 |
that has support for WSL activated. For further details, refer |
| 43 |
to: :ref:`building_wsl_build`. |
| 44 |
|
| 45 |
KIS Root Filesystem Image |
| 46 |
An optional root filesystem image associated with a kernel and initrd. |
| 47 |
The use case for this component image type is highly customizable. |
| 48 |
Many different deployment strategies are possible. |
| 49 |
For further details, refer to: :ref:`kis`. |
| 50 |
|
| 51 |
AWS Nitro Enclave |
| 52 |
An initrd-based image using the `eif` binary format. The image is |
| 53 |
expected to be used in the AWS Nitro Enclave system or for testing |
| 54 |
in QEMU. For further details, refer to: :ref:`eif`. |
| 55 |
|
| 56 |
Image Results |
| 57 |
------------- |
| 58 |
|
| 59 |
{kiwi} execution results in an appliance image after a successful run of |
| 60 |
the :ref:`kiwi_system_build` or :ref:`kiwi_system_create` command. |
| 61 |
The result is the image binary plus some additional metadata files |
| 62 |
that are needed for image deployment and/or exist for informative |
| 63 |
reasons. By default, the output files follow this naming convention: |
| 64 |
|
| 65 |
`<image-name>.\<arch\>-\<version\>.\<extension\>` |
| 66 |
|
| 67 |
where `<image-name>` is the name stated in the :ref:`image-description` as an |
| 68 |
attribute of the :ref:`sec.image` element. The `<arch>` is the CPU |
| 69 |
architecture used for the build, `<version>` is the image version defined in |
| 70 |
the :ref:`<version><sec.preferences>` element of the image description, |
| 71 |
and the `<extension>` is dependent on the image type and its definition. |
| 72 |
|
| 73 |
Any {kiwi} appliance build results in, at least, the following output files: |
| 74 |
|
| 75 |
1. The image binary, `<image-name>.\<arch\>-\<version\>.\<image-extension\>`: |
| 76 |
|
| 77 |
This is the file containing the actual image binary. Depending |
| 78 |
on the image type and its definition, it can be a virtual disk image |
| 79 |
file, an ISO image, a tarball, etc. |
| 80 |
|
| 81 |
2. The `<image-name>.<arch>-<version>.packages` file: |
| 82 |
|
| 83 |
This file includes a sorted list of the packages |
| 84 |
that are included in the image. In fact, this is a normalized dump of the |
| 85 |
package manager database. It follows the following CSV format, where each |
| 86 |
line is represented by: |
| 87 |
|
| 88 |
`<name>|\<epoch\>|\<version\>|\<release\>|\<arch\>|\<disturl\>|\<license\>` |
| 89 |
|
| 90 |
The values represented here are mainly based on RPM packages' metadata. |
| 91 |
Other package managers may not provide all of these values. In such cases, |
| 92 |
the format is the same, and the fields that cannot be provided are set as |
| 93 |
`None`. This list can be used to track changes across multiple |
| 94 |
builds of the same image description over time by diffing the |
| 95 |
packages installed. |
| 96 |
|
| 97 |
3. The `<image-name>.<arch>-<version>.verified` file: |
| 98 |
|
| 99 |
This file is the output of a verification done by the package manager |
| 100 |
against the package database. More specifically, it is the output of |
| 101 |
the `rpm` verification process or `dpkg` verification, |
| 102 |
depending on the packaging technology selected for the image. |
| 103 |
In both cases, the output follows the RPM verification syntax. This |
| 104 |
provides an overview of all package statuses right before any boot of |
| 105 |
the image. |
| 106 |
|
| 107 |
Depending on the image type, the following output files exist: |
| 108 |
|
| 109 |
image="tbz" |
| 110 |
For this image type, the result is mainly a root tree packed in a tarball: |
| 111 |
|
| 112 |
- **root archive**: |
| 113 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.tar.xz` |
| 114 |
|
| 115 |
image="btrfs|ext2|ext3|ext4|squashfs|xfs" |
| 116 |
The image root tree data is packed into a filesystem image of the given |
| 117 |
type; hence, the result for an `ext4` image would be: |
| 118 |
|
| 119 |
- **filesystem image**: |
| 120 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.ext4` |
| 121 |
|
| 122 |
image="iso" |
| 123 |
The image result is an ISO file: |
| 124 |
|
| 125 |
- **live image**: |
| 126 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.iso` |
| 127 |
|
| 128 |
image="oem" |
| 129 |
An image representing an expandable disk image. {kiwi} can also produce an |
| 130 |
installation ISO for this disk image by setting `installiso="true"` in |
| 131 |
the :ref:`\<preferences\>\<type\><sec.preferences>`) section or a tarball, |
| 132 |
including the artifacts for a network deployment, by setting `installpxe="true"`. |
| 133 |
For further details, see :ref:`expandable_disk`. The results for `oem` |
| 134 |
can be: |
| 135 |
|
| 136 |
- **disk image**: |
| 137 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.raw` |
| 138 |
- **installation image (optional)**: |
| 139 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.install.iso` |
| 140 |
- **installation pxe archive (optional)**: |
| 141 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.install.tar` |
| 142 |
|
| 143 |
The disk image can also be provided in one of the various virtual disk |
| 144 |
formats, which can be specified in the `format` attribute of the |
| 145 |
:ref:`\<preferences\>\<type\><sec.preferences>` section. For further |
| 146 |
details, see :ref:`simple_disk`. The result for e.g., `format="qcow2"` |
| 147 |
would be: |
| 148 |
|
| 149 |
- **disk image**: |
| 150 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.qcow2` |
| 151 |
|
| 152 |
instead of the `.raw` default disk format. |
| 153 |
|
| 154 |
image="docker" |
| 155 |
An archive image suitable for the Docker container engine. The result is |
| 156 |
a loadable (`docker load -i <image>`) tarball: |
| 157 |
|
| 158 |
- **container**: |
| 159 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.docker.tar.xz` |
| 160 |
|
| 161 |
image="oci" |
| 162 |
An archive image that builds a container matching the OCI |
| 163 |
(Open Container Interface) standard. The result is a tarball matching OCI |
| 164 |
standards: |
| 165 |
|
| 166 |
- **container**: |
| 167 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.oci.tar.xz` |
| 168 |
|
| 169 |
image="appx" |
| 170 |
An archive image suitable for the Windows Subsystem for Linux |
| 171 |
container engine. The result is an `appx` binary file: |
| 172 |
|
| 173 |
- **container**: |
| 174 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.appx` |
| 175 |
|
| 176 |
image="wsl" |
| 177 |
An archive image suitable for the Windows Subsystem for Linux |
| 178 |
container engine >= v2.4.4. The result is a gzip-compressed tar |
| 179 |
archive with the `.wsl` extension: |
| 180 |
|
| 181 |
- **container**: |
| 182 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.wsl` |
| 183 |
|
| 184 |
image="kis" |
| 185 |
An optional root filesystem image associated with a kernel and initrd. |
| 186 |
All three binaries are packed in a tarball. See :ref:`kis` for further |
| 187 |
details about the kis archive: |
| 188 |
|
| 189 |
- **kis archive**: |
| 190 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.tar.xz` |
| 191 |
|
| 192 |
Image Bundle Format |
| 193 |
------------------- |
| 194 |
|
| 195 |
The result files as mentioned above are used in the {kiwi} result bundler. |
| 196 |
The `kiwi-ng result bundle` command can be used to copy or package the |
| 197 |
mandatory image files to create a customer release. In this process, it's |
| 198 |
possible to apply a specific name pattern suitable for the requirements |
| 199 |
of the release. A typical result bundle call can look like the following: |
| 200 |
|
| 201 |
.. code:: bash |
| 202 |
|
| 203 |
$ kiwi-ng result bundle --target-dir /path/to/image/build_result \ |
| 204 |
--bundle-dir=/path/to/image/release_result \ |
| 205 |
--id=release_identifier |
| 206 |
|
| 207 |
In this call, and depending on the image type, the required files as they |
| 208 |
exist in :file:`/path/to/image/build_result` are copied to |
| 209 |
:file:`/path/to/image/release_result/`. The only modification to the file |
| 210 |
names is the `--id` information, which is appended with a `-` at the |
| 211 |
end of the version substring. If we take |
| 212 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}.iso` as an example. |
| 213 |
This file would be bundled as |
| 214 |
:file:`{exc_image_base_name}.x86_64-{exc_image_version}-release_identifier.iso`. |
| 215 |
|
| 216 |
Depending on the use case and the customer requirements, this naming |
| 217 |
schema and the default way the kiwi bundler processes the result files |
| 218 |
is not appropriate. To allow for a more flexible naming schema when |
| 219 |
bundling results, {kiwi} allows you to specify a bundle_format per type, like |
| 220 |
in the following example: |
| 221 |
|
| 222 |
.. code:: xml |
| 223 |
|
| 224 |
<type image="..." bundle_format="name_pattern"> |
| 225 |
<!-- type definition --> |
| 226 |
</type> |
| 227 |
|
| 228 |
The specified `name_pattern` is used as the base name for the image |
| 229 |
files the bundler uses. As part of the `name_pattern`, the following |
| 230 |
placeholders, which are replaced by their real value, can be used: |
| 231 |
|
| 232 |
%N |
| 233 |
Turns into the contents of the `name` attribute of the `<image>` section. |
| 234 |
|
| 235 |
%P |
| 236 |
Turns into the profile name used at build time of the image. |
| 237 |
If multiple profiles were used to build the image, the result |
| 238 |
name consists of the individual profile names concatenated |
| 239 |
by a `_` in the order of their specification in the image |
| 240 |
description and/or the command line. |
| 241 |
|
| 242 |
%A |
| 243 |
Turns into the architecture name at build time of the image. |
| 244 |
Arch names are taken from Python's `platform.machine` information. |
| 245 |
|
| 246 |
%I |
| 247 |
Turns into the identifier name given via the `--id` option at the |
| 248 |
call time of the bundler. |
| 249 |
|
| 250 |
%T |
| 251 |
Turns into the contents of the `image` attribute of the `<type>` section. |
| 252 |
|
| 253 |
%M |
| 254 |
Turns into the major number of the `<version>` section. |
| 255 |
|
| 256 |
%m |
| 257 |
Turns into the minor number of the `<version>` section. |
| 258 |
|
| 259 |
%p |
| 260 |
Turns into the patch number of the `<version>` section. |
| 261 |
|
| 262 |
%v |
| 263 |
Turns into the version text of the `<version>` section. |