diff options
Diffstat (limited to 'documentation/ref-manual/classes.rst')
| -rw-r--r-- | documentation/ref-manual/classes.rst | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/documentation/ref-manual/classes.rst b/documentation/ref-manual/classes.rst index bc7ccb8b71..a6cf586dd5 100644 --- a/documentation/ref-manual/classes.rst +++ b/documentation/ref-manual/classes.rst | |||
| @@ -1248,6 +1248,53 @@ The :ref:`ref-classes-image_types` class also handles conversion and compression | |||
| 1248 | :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk | 1248 | :term:`IMAGE_FSTYPES`. This would also be similar for Virtual Box Virtual Disk |
| 1249 | Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images. | 1249 | Image ("vdi") and QEMU Copy On Write Version 2 ("qcow2") images. |
| 1250 | 1250 | ||
| 1251 | .. _ref-classes-image-container: | ||
| 1252 | |||
| 1253 | ``image-container`` | ||
| 1254 | =================== | ||
| 1255 | |||
| 1256 | The :ref:`ref-classes-image-container` class is automatically inherited in | ||
| 1257 | :doc:`image </ref-manual/images>` recipes that have the ``container`` image type | ||
| 1258 | in :term:`IMAGE_FSTYPES`. It provides relevant settings to generate an image | ||
| 1259 | ready for use with an :wikipedia:`OCI <Open_Container_Initiative>`-compliant | ||
| 1260 | container management tool, such as :wikipedia:`Podman <Podman>` or | ||
| 1261 | :wikipedia:`Docker <Docker_(software)>`. | ||
| 1262 | |||
| 1263 | .. note:: | ||
| 1264 | |||
| 1265 | This class neither builds nor installs container management tools on the | ||
| 1266 | target. Those tools are available in the :yocto_git:`meta-virtualization | ||
| 1267 | </meta-virtualization>` layer. | ||
| 1268 | |||
| 1269 | You should set the :term:`PREFERRED_PROVIDER` for the Linux kernel to | ||
| 1270 | ``linux-dummy`` in a :term:`configuration file`:: | ||
| 1271 | |||
| 1272 | PREFERRED_PROVIDER_virtual/kernel = "linux-dummy" | ||
| 1273 | |||
| 1274 | Otherwise an error is triggered. If desired, the | ||
| 1275 | :term:`IMAGE_CONTAINER_NO_DUMMY` variable can be set to "1" to avoid triggering | ||
| 1276 | this error. | ||
| 1277 | |||
| 1278 | The ``linux-dummy`` recipe acts as a Linux kernel recipe but builds nothing. It | ||
| 1279 | is relevant to use as the preferred Linux kernel provider in this case as a | ||
| 1280 | container image does not need to include a Linux kernel. Selecting it as the | ||
| 1281 | preferred provider for the kernel will also decrease build time. | ||
| 1282 | |||
| 1283 | Using this class only deploys an additional ``tar.bz2`` archive to | ||
| 1284 | :term:`DEPLOY_DIR_IMAGE`. This archive can be used in a container file (a file | ||
| 1285 | typically named ``Dockerfile`` or ``Containerfile``). For example, to be used with | ||
| 1286 | :wikipedia:`Podman <Podman>` or :wikipedia:`Docker <Docker_(software)>`, the | ||
| 1287 | `container file <https://docs.docker.com/reference/dockerfile/>`__ could contain | ||
| 1288 | the following instructions: | ||
| 1289 | |||
| 1290 | .. code-block:: dockerfile | ||
| 1291 | |||
| 1292 | FROM scratch | ||
| 1293 | ADD ./image-container-qemux86-64.rootfs.tar.bz2 / | ||
| 1294 | ENTRYPOINT /bin/sh | ||
| 1295 | |||
| 1296 | This is suitable to build a container using our generated root filesystem image. | ||
| 1297 | |||
| 1251 | .. _ref-classes-image-live: | 1298 | .. _ref-classes-image-live: |
| 1252 | 1299 | ||
| 1253 | ``image-live`` | 1300 | ``image-live`` |
