Skip to content

Configuring the image ​

The image is configured using a YAML configuration file and the apm system image build command.

Basic config ​

The initial file from which the configuration starts is /etc/apm/image.yml.

apm system image build applies changes to the current container based on the settings in image.yml.

Clarification

When creating an image in CI/CD, the configuration file is copied or mounted using Containerfile from the repository to the container via the aforementioned path.

Example

ALT Atomic Core:

yml
image: ${{ Env.IMAGE }}

modules:
  - name: Set repos
    type: repos
    body:
      branch: sisyphus
      date: ${{ Env.YEAR }}/${{ Env.MONTH }}/${{ Env.DAY }}
      clean: true

  - type: packages
    body:
      update: true
      upgrade: true

  - name: Set branding
    type: branding
    body:
      name: alt-atomic-${{ Env.IMAGE_NAME }}
      build-type: ${{ Env.IMAGE_TYPE }}

  - name: Copy root
    type: copy
    body:
      source: root
      destination: /
      replace: true

  - type: include
    body:
      targets:
        - packages.yml
        - network.yml
        - apt-rpm.yml
        - filesystem.yml
        - systemd.yml
        - settings.yml
        - passwd.yml
        - disable-bins.yml

  - name: Configurate grub
    type: shell
    body:
      command: scripts/grub.sh

  - name: Update kernel
    type: kernel
    body:
      kernel-info:
        flavour: std-def
        modules:
          - drm
      initrd:
        method: dracut

  - name: Cleanup
    type: include
    body:
      targets:
        - cleanup.yml

Fields of the configuration file ​

Legend

! — required field

FieldTypeDescription
imagestringBase image to use (reference to the container).
modulesmodule[]List of modules.
envmap<string, string>Environment variables. Can be used in any module.

image is a required field when using apm s i apply or apm s i update.

Modules (modules) ​

Array of modules for execution.

! marks required fields. Boolean fields default to false; lists are YAML sequences, and map<string, string> is a mapping of strings. Quote string versions and dates, for example "0.7.1" and "2026-11-08". Module-specific fields belong inside body.

FieldTypeDescription
namestringThe name of the module for logging.
type!stringThe type of the module body.
idstringThe module identifier. For more details, see the section "Module Identifier".
envmap<string, string>Environment variables for the module. They can only be used within the scope of this module.
ifstringCondition in the Expr language format.
body!objectModule body.
outputmap<string, string>Data for output.

Module Identifier (id) ​

The identifier allows you to access the module to obtain the values of the following fields:

  • Name (name)
  • Type (type)
  • Identifier (id)
  • Result of the conditional expression (if)
  • Output data (output)

Branding (branding) ​

The branding module installs branding packages and configures os-release and OS metadata.

FieldTypeDescription
namestringBranding name for branding-<name>-* packages.
subpackagesstring[]Branding subpackages; defaults to all. Requires name.
release-overridesmap<string, string>os-release overrides. An empty string removes a field.
build-typestringBuild type: stable (default), nightly, or another development type.
metainfoobjectOS metadata for generating .metainfo.xml.

On classic systems, release-overrides updates /etc/os-release, falling back to /usr/lib/os-release when absent. Atomic normalization applies only to atomic systems, when installing the release subpackage or specifying release-overrides.

OS metadata ​

Translation keys: C for the original text, other keys for locales (ru, en, etc.). description uses AppStream XML markup: p, ul, ol, li.

FieldTypeDescription
namemap<string, string>OS name. Missing C defaults to NAME from os-release.
summarymap<string, string>Short description. Missing C defaults to NAME.
descriptionmap<string, string>Description with XML markup.
variantsobject[]Image variants.
latest-releaseobjectLatest release information.

variants subsection (list; x-variants in XML):

FieldTypeDescription
imagestringContainer image reference.
namemap<string, string>Variant name.
summarymap<string, string>Short variant description.
descriptionmap<string, string>Variant description with XML markup.

latest-release schema:

FieldTypeDescription
versionstringRelease version; defaults to VERSION_ID from os-release.
datestringRelease date (YYYY-MM-DD).
descriptionmap<string, string>Release description with XML markup.

The remaining XML fields are generated automatically:

XML fieldSource
component/@typeoperating-system
idOS ID according to AppStream (appstreamcli sysinfo)
url type="homepage"HOME_URL
developer/@idReverse domain of VENDOR_URL
developer/nameVENDOR_NAME; the developer block is omitted without it
metadata_licenseFSFAP

If an operating-system component with this ID is found in local metainfo or AppStream catalogs, XML generation is skipped when metainfo is absent; if it is specified (including {}), a conflict error is returned. Otherwise, /usr/share/metainfo/<id>.metainfo.xml is created using the YAML settings and defaults from os-release. Branding installation and os-release changes take place before this check.

Example: ALT Atomic Onyx metadata
yaml
modules:
  - type: branding
    body:
      name: alt-atomic-onyx
      release-overrides:
        NAME: ALT Atomic Onyx
        HOME_URL: https://alt-atomic.org/
        VENDOR_URL: https://alt-atomic.org/
        VENDOR_NAME: ALT Atomic Team
      metainfo:
        name:
          ru: ALT Atomic Оникс
        summary:
          C: Atomic desktop operating system with GNOME
          ru: Атомарная настольная ОС с GNOME
        description:
          C: |
            <p>ALT Atomic Onyx is an atomic operating system with GNOME.</p>
          ru: |
            <p>ALT Atomic Onyx — атомарная операционная система с GNOME.</p>
        variants:
          - image: altlinux.space/alt-atomic/onyx/stable:latest
            name:
              C: ALT Atomic Onyx
            summary:
              C: Default GNOME image
          - image: altlinux.space/alt-atomic/onyx-nvidia/stable:latest
            name:
              C: ALT Atomic Onyx (NVIDIA)
            summary:
              C: Image with NVIDIA drivers
        latest-release:
          version: "0.7.1"
          date: "2026-11-08"
          description:
            C: |
              <p>Updated system components.</p>

name.C defaults to NAME. The example assumes that no OS component with the same ID is installed.

Copying (copy) ​

The copy module is designed for copying files and directories.

Legend

! — required field

FieldTypeDescription
source!stringPath to the file to copy.
destination!stringPath to the file to copy to.
replacebooleanWhether to replace destination.
Example

ALT Atomic Core:

yaml
  - name: Copy root
    type: copy
    body:
      source: root
      destination: /
      replace: true

Git (git) ​

The git module is designed to work with Git repositories: installing dependencies, building, installing the results of the work in the system, and so on.

Legend

! — required field

FieldTypeDescription
url!stringURL of the git repository.
command!stringCommands to execute relative to the git repository.
build-depsstring[]Dependencies for the build. They will be removed after the module is completed.
depsstring[]Dependencies for the program itself. They will not be removed after the module is completed, even if specified in build-deps.
revstringGit revision.
quietbooleanHides command output.

Including other configs (include) ​

The include module is intended for including other configurations.

Legend

! — required field

FieldTypeDescription
targets!string[]YAML configs for execution
Example

ALT Atomic Core:

yaml
  - name: Cleanup
    type: include
    body:
      targets:
        - cleanup.yml

Working with the kernel (kernel) ​

The kernel module is designed to select the kernel version (flavour), connect additional modules, include headers, and rebuild initramfs.

FieldTypeDescription
kernel-infoobjectWorking with the kernel and kernel modules
initrdobjectWorking with initrd

The kernel-info subsection

FieldTypeDescription
flavourstringKernel version
modulesstring[]Names of the kernel modules (kernel-module-<name>-<flavour>)
include-headersbooleanWhether to include core headers
no-inherit-modulesbooleanDo not inherit modules from the installed kernel when installing the selected kernel.

The initrd subsection

FieldTypeDescription
methodstringauto, dracut, make-initrd, none, or an empty string. Empty selects auto when configuring the kernel; none disables rebuilding.
plymouth-themestringTheme plymouth-theme-<name>; disabled disables Plymouth. If method is omitted, auto is used.
Example

ALT Atomic Core:

yaml
  - name: Update kernel
    type: kernel
    body:
      kernel-info:
        flavour: ${{ Env.KERNEL_FLAVOUR }}
        modules:
          - drm
      initrd:
        method: dracut

The link module is designed to create symbolic links to objects.

Legend

! — required field

FieldTypeDescription
target!stringWhere to create the link, absolute path
to!stringWhere it will lead
replacebooleanWhether to replace target
Example

ALT Atomic Core

yaml
  - type: link
    body:
      target: /ostree
      to: /sysroot/ostree
      replace: true

Merging file contents (merge) ​

The merge module is designed to merge files.

Legend

! — required field

FieldTypeDescription
source!stringPath to the file whose contents need to be taken
destination!stringPath to the file where the contents need to be added
create-file-permstringPermissions for creating a file in the rwxrwxrwx format if it doesn’t exist
prependbooleanShould the content be added to the beginning of the file?

Creating directories (mkdir) ​

The mkdir module is designed to create directories at the specified paths with defined ownership rights.

Legend

! — required field

FieldTypeDescription
targets!string[]Paths where directories need to be created
perm!stringPermissions for directories in the format rwxrwxrwx
Example

ALT Atomic Core:

yaml
  - type: mkdir
    body:
      targets:
        - /sysroot
      perm: rwxr-xr-x

Moving objects (move) ​

The move module is designed to move objects in the file system, with the option to leave a reference in place of the moved object.

Legend

! — required field

FieldTypeDescription
source!stringWhat
destination!stringWhere
replacebooleanReplace the object at destination
create-linkbooleanCreate a link from the target’s parent directory to the destination
Example

ALT Atomic Core:

yaml
  - type: move
    body:
      source: /etc/apt
      destination: /usr/share/apt
      create-link: true

Network configuration (network) ​

The network module is designed to configure network settings.

Legend

! — required field

FieldTypeDescription
hostname!stringDevice network name
Example

ALT Atomic Core:

yaml
  - type: network
    body:
      hostname: alt-atomic-${{ Env.IMAGE_NAME }}

Working with packages (packages) ​

The packages module is designed to work with packages: installation, removal, updating the database and the packages themselves.

FieldTypeDescription
installstring[]Packages to be installed
removestring[]Packages to be removed
updatebooleanWhether to update the database before the transaction
upgradebooleanWhether to update the packages before the transaction
dependsbooleanRemove packages with dependencies
optionsmap<string, string>APT overrides for module operations, for example Dir::Cache::Archives: /tmp/apt-cache. Values are strings.
Example

ALT Atomic Core:

yaml
  - type: packages
    body:
      install:
        - glxinfo
        - mesa-dri-drivers
      update: true
      upgrade: true

Removing objects (remove) ​

The remove module is designed to delete objects.

Legend

! — required field

FieldTypeDescription
targets!string[]Path to the objects that need to be deleted
insidebooleanClear objects instead of deleting
Example

ALT Atomic Core:

yaml
  - name: Clean logs
    type: remove
    body:
      targets:
        - /var/log/README.logs
        - /var/log/rpmpkgs
      inside: true

Changing the file content (replace) ​

The replace module is designed to replace the contents of a file based on a regular expression.

Legend

! — required field

FieldTypeDescription
target!stringPath to the file
pattern!stringRegular expression pattern
repl!stringReplacement

Working with repositories (repos) ​

The repos module is designed to clean, install custom or pre-installed repositories, and add tasks (projects).

Legend

! — required field

FieldTypeDescription
cleanbooleanClear all repositories. Conflicts with clean-temporary
customstring[]Custom entries in sources.list
branchstringALT repository branch. Comments out the remaining repositories; to clean up, use clean
datestringDate "YYYYMMDD", "YYYY/MM/DD", or latest. An empty value selects the regular repository. Requires branch.
tasksstring[]Tasks to be included as repositories
no-updatebooleanDo not update the database after saving the repositories
clean-temporarybooleanClear temporary repositories. Conflicts with clean

Use apm repo branches to list available branches (for example, sisyphus and p11).

Example

ALT Atomic Core:

yaml
  - name: Set repos
    type: repos
    body:
      branch: sisyphus
      date: ${{ Env.YEAR }}/${{ Env.MONTH }}/${{ Env.DAY }}
      clean: true

Executing scripts (shell) ​

The shell module is designed to execute imperative code in Bash.

Legend

! — required field

FieldTypeDescription
command!stringCommands to execute
quietbooleanHides command output
Example

ALT Atomic Core:

yaml
  - name: Set root password
    type: shell
    body:
      command: echo "root:root" | chpasswd

Working with SystemD services (systemd) ​

The systemd module is designed to monitor the status of SystemD.

Legend

! — required field

FieldTypeDescription
targets!string[]Service names
enabledbooleanWhether to enable the service or not. Conflicts with masked
globalbooleanWhether to enable the service globally, for all users
maskedbooleanWhether to mask the service. Conflicts with enabled
Example

ALT Atomic Core:

yaml
  - type: systemd
    body:
      targets:
        - ostree-remount
        - NetworkManager
        - libvirtd
        - chrony
        - podman.socket
        - sync-users.service
        - sync-directory.service
        - tmp.mount
      enabled: true

Released under the GPL-3.0+ license. Content is available under the CC BY-SA 4.0 license, unless otherwise stated.