meta-virtualization/classes
Bruce Ashfield 29c60173e2 containers: introduce image-oci
This image class creates an oci image spec directory from a generated
rootfs. The contents of the rootfs do not matter (i.e. they need not be
container optimized), but by using the container image type and small
footprint images, we can create directly executable container images.

Once the tarball (or oci image directory) has been created of the OCI
image, it can be manipulated by standard tools. For example, to create a
runtime bundle from the oci image, the following can be done:

Assuming the image name is "container-base":

  If the oci image was a tarball, extract it (skip, if a directory is being directly used)
    % tar xvf container-base-<arch>-<stamp>.rootfs-oci-latest-x86_64-linux.oci-image.tar

  And then create the bundle:
    % oci-image-tool create --ref name=latest container-base-<arch>-<stamp>.rootfs-oci container-base-oci-bundle

  Or to copy (push) the oci image to a docker registry, skopeo can be used (vary the
  tag based on the created oci image:

    % skopeo copy --dest-creds <username>:<password> oci:container-base-<arch>-<stamp>:latest docker://zeddii/container-base

The following image variables are available to customize the details
of the constructed image (defaults as shown):

   OCI_IMAGE_AUTHOR ?= "${PATCH_GIT_USER_NAME}"
   OCI_IMAGE_AUTHOR_EMAIL ?= "${PATCH_GIT_USER_EMAIL}"

   OCI_IMAGE_TAG ?= "latest"
   OCI_IMAGE_RUNTIME_UID ?= ""

   OCI_IMAGE_ARCH ?= "${TARGET_ARCH}"
   OCI_IMAGE_SUBARCH ?= "${@oci_map_subarch(d.getVar('TARGET_ARCH'), d.getVar('TUNE_FEATURES'), d)}"

   OCI_IMAGE_ENTRYPOINT ?= "sh"
   OCI_IMAGE_ENTRYPOINT_ARGS ?= ""
   OCI_IMAGE_WORKINGDIR ?= ""

   //List of ports to expose from a container running this image:
   //PORT[/PROT]
   //  format: <port>/tcp, <port>/udp, or <port> (same as <port>/tcp).
   OICI_IMAGE_PORTS ?= ""

   // key=value list of labels
   OCI_IMAGE_LABELS ?= ""
   // key=value list of environment variables
   OCI_IMAGE_ENV_VARS ?= ""

Signed-off-by: Bruce Ashfield <bruce.ashfield@gmail.com>
2019-02-27 11:46:25 -05:00
..
image-oci.bbclass containers: introduce image-oci 2019-02-27 11:46:25 -05:00
sanity-meta-virt.bbclass sanity-meta-virt: Watch for SanityCheck event 2017-10-12 21:59:51 -04:00