suse-edge / edge-image-builder

Tool for creating and configuring a set of images to automate the deployment of Edge environments
Apache License 2.0
33 stars 20 forks source link

Edge Image Builder (EIB)

Usage

EIB runs as a container. Some form of container runtime is needed, such as Podman.

The latest version of EIB (1.0.2) can be downloaded from the Open Build Service using the following command:

podman pull registry.opensuse.org/isv/suse/edge/edgeimagebuilder/containerfile/suse/edge-image-builder:1.0.2

Alternatively, EIB can be built from this repository. See the Building from Source section below.

Image Definition

For details on how to create the artifacts needed to build an image, see the Building Images guide.

Running EIB

The image configuration directory must be attached to the container at runtime. This serves as both the mechanism to introduce image definition files and provide a way to get the built image out of the container and onto the host machine.

Validating an image definition

The following example command attaches the image configuration directory and validates a definition:

podman run --rm -it -v $IMAGE_DIR:/eib \
$EIB_IMAGE \
validate --definition-file $DEFINITION_FILE.yaml

Building an image

The following example command attaches the image configuration directory and builds an image:

podman run --rm -it -v $IMAGE_DIR:/eib \
$EIB_IMAGE \
build --definition-file $DEFINITION_FILE.yaml

NOTE: Image builds which involve package resolution must include the --privileged flag. Package resolution will be automatically performed when requesting package installation or configuring components which require it (e.g. Elemental, Kubernetes SELinux, etc.).

Testing Images

For details on how to test the built images, see the Testing Guide.

Building from Source

Prerequisites

Before building the EIB image, make sure that you have the development headers and libraries for gpgme, device-mapper and libbtrfs installed on your system:

SUSE Linux:

sudo zypper install -y gpgme-devel device-mapper-devel libbtrfs-devel

Ubuntu:

sudo apt-get install -y libgpgme-dev libdevmapper-dev libbtrfs-dev

Fedora:

sudo dnf -y install gpgme-devel device-mapper-devel btrfs-progs-devel

Building

Build the container (from the root of this project). In the example below, the image tag eib:dev will be used in the podman command examples above for the $EIB_IMAGE variable.

podman build -t eib:dev .