Configuration

October 5, 2021 ยท View on GitHub

Runtime configuration

The runtime can be configured through the file enroot.conf (under /etc/enroot by default) or by using environment variables. Environment variables take precedence over the configuration file.

The following table describes standard paths used by the runtime:

SettingDefaultDescription
ENROOT_LIBRARY_PATH/usr/lib/enrootPath to library sources
ENROOT_SYSCONF_PATH/etc/enrootPath to system configuration files
ENROOT_RUNTIME_PATH${XDG_RUNTIME_DIR}/enrootPath to the runtime working directory
ENROOT_CONFIG_PATH${XDG_CONFIG_HOME}/enrootPath to user configuration files
ENROOT_CACHE_PATH${XDG_CACHE_HOME}/enrootPath to user image/credentials cache
ENROOT_DATA_PATH${XDG_DATA_HOME}/enrootPath to user container storage
ENROOT_TEMP_PATH${TMPDIR}Path to temporary directory

When enroot.conf has been read, and if there is a directory enroot.conf.d next to enroot.conf, all files in that directory matching *.conf will be considered, too.

Container configuration

Common configurations can be applied to all containers by leveraging the following directories under ENROOT_SYSCONF_PATH (system-wide) and/or ENROOT_CONFIG_PATH (user-specific).

DirectoryDescription
environ.dEnvironment configuration files
mounts.dMount configuration files
hooks.dPre-start hook scripts

Environment configuration files

Environment files are used to export environment variables inside containers.
They have the .env extension and follow the same format as described in Image format (/etc/environment).

Mount configuration files

Mount files are used to mount filesystems, files or directories inside containers.
They have the .fstab extension and follow the same format as described in Image format (/etc/fstab).

Pre-start hook scripts

Pre-start hooks are used to perform specific actions before the container starts.
They are standard bash scripts with the .sh extension and run with full capabilities before the container has switched to its final root.

The host environment as well as the following environment variables are made available to hooks and configuration files:

EnvironmentDescription
ENROOT_PIDPID of the container
ENROOT_ROOTFSPath to the container root filesystem
ENROOT_MOUNTSPath to the container mount file to be read at startup
ENROOT_ENVIRONPath to the container environment file to be read at startup