Repositories

KIWI NG installs the packages of an image from the repositories of the image description, at least one repository is required. Each repository is a repository element with a source child element, which holds the location of the repository in its path attribute:

<image schemaversion="8.5" name="kiwi-test-image-some">
    <!-- snip -->
    <repository type="rpm-md" alias="kiwi" priority="1">
        <source path="obs://Virtualization:Appliances:Builder/openSUSE_Leap_16.0"/>
    </repository>
    <repository type="rpm-md" alias="OS" imageinclude="true">
        <source path="obs://openSUSE:Leap:16.0/standard"/>
    </repository>
</image>

The example adds the KIWI NG repository and the repository of the operating system, both from the Open Build Service. The repository of the operating system is also configured in the resulting image.

The repository element supports the following optional attributes:

Attribute

Description

alias

The name of the repository, shown for example by zypper repos or dnf repolist. Without it, KIWI NG generates a name.

priority

The priority of the repository if a package is available in more than one repository. zypper and dnf prefer the lower value, apt prefers the higher value, see apt_preferences(5).

imageinclude

true configures the repository in the resulting image as well. The default is false.

imageonly

true configures the repository only in the resulting image, it is not used for the build. The default is false.

repository_gpgcheck

true validates the signature of the repository. The default is false.

package_gpgcheck

true validates the signature of each package from the repository. The default is false.

components

The distribution components of a deb repository. The default is main.

distribution

The distribution name of a deb repository.

profiles

The profiles the repository is used for, see Profiles.

customize

A script which modifies the repository files KIWI NG creates, for settings the schema does not support. It is called with the path of each repository file. A relative path is looked up in the image description directory.

For example, a customize script which adds the module_hotfixes option to a dnf repository file:

repo_file=$1
echo 'module_hotfixes = 1' >> ${repo_file}

Repository Paths

The path attribute of the source element supports the following locations:

Path

Location

http://, https://, ftp://

A repository on a server.

obs://$PROJECT/$REPOSITORY

The repository $REPOSITORY of the project $PROJECT on the Open Build Service. The default instance is build.opensuse.org, it can be changed in the runtime configuration file. Repositories from different instances are not supported, use the URL of the repository instead.

obsrepositories:/

For builds in the Open Build Service only: the repositories of the project which holds the image. This sets up the repositories in the Open Build Service instead of in the image description.

dir:///path or file:///path

A local directory or file on the build host.