Building Images with Profiles

KIWI supports so-called profiles inside the XML image description. Profiles act as namespaces for additional settings to be applied on top of the defaults. For further details, see Image Profiles.

Local Builds

To execute local KIWI builds with a specific, selected profile, add the command line flag --profile=$PROFILE_NAME:

$ sudo kiwi-ng --type iso system build \
      --profile=workstation \
      --description kiwi-descriptions/suse/x86_64/suse-leap-15.1-JeOS \
      --target-dir /tmp/myimage

Consult the manual page of kiwi for further details: kiwi.

Building with the Open Build Service

The Open Build Service (OBS) support profiles via the multibuild feature. An example project using this feature is the openSUSE-Tumbleweed-JeOS image.

To enable and use the profiles, follow these steps:

  1. Add the following XML comment to your config.xml:

    <!-- OBS-Profiles: @BUILD_FLAVOR@ -->
    

    It must be added before the opening <image> element and after the <?xml?> element, e.g.:

    <?xml version="1.0" encoding="utf-8"?>
    <!-- OBS-Profiles: @BUILD_FLAVOR@ -->
    <image schemaversion="7.1" name="LimeJeOS-Leap-15.1">
      <!-- snip -->
    </image>
    
  2. Add a file _multibuild into your package’s repository with the following contents:

    <multibuild>
      <flavor>profile_1</flavor>
      <flavor>profile_2</flavor>
    </multibuild>
    

    Add a line <flavor>$PROFILE</flavor> for each profile that you want OBS to build.

Note, by default, OBS excludes the build without any profile enabled.

Running a build of a multibuild enabled repository via osc can be achieved via the -M $PROFILE flag:

$ osc build -M $PROFILE