summaryrefslogtreecommitdiffstats
path: root/docs/CONTAINER_INTERFACE.md
diff options
context:
space:
mode:
authorLuca Boccassi <luca.boccassi@microsoft.com>2020-05-22 17:05:12 +0200
committerLuca Boccassi <luca.boccassi@microsoft.com>2020-06-23 13:57:05 +0200
commit34e0d56ce23fcdfd264ad5e8ada58a520c23a80f (patch)
tree0254a326366ae75d36e23669dfd878ce12535d9c /docs/CONTAINER_INTERFACE.md
parentnspawn: use mkdir_p_safe instead of homegrown version (diff)
downloadsystemd-34e0d56ce23fcdfd264ad5e8ada58a520c23a80f.tar.xz
systemd-34e0d56ce23fcdfd264ad5e8ada58a520c23a80f.zip
Container interface: document exposing the host's os-release
In order to allow applications to detect the host OS version or other metadata, ask container managers to expose the os-release files as read-only bind mounts. For systemd-nspawn, we will also expose ID, BUILD_ID, VERSION_ID and VARIANT_ID as lowercase environment variables prefixed by the container_host_ string.
Diffstat (limited to 'docs/CONTAINER_INTERFACE.md')
-rw-r--r--docs/CONTAINER_INTERFACE.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/docs/CONTAINER_INTERFACE.md b/docs/CONTAINER_INTERFACE.md
index 71f9185c58..a36d2edc72 100644
--- a/docs/CONTAINER_INTERFACE.md
+++ b/docs/CONTAINER_INTERFACE.md
@@ -121,6 +121,16 @@ manager, please consider supporting the following interfaces.
`container_ttys=pts/7 pts/8 pts/14` it will spawn three additional login
gettys on ptys 7, 8, and 14.
+4. To allow applications to detect the OS version and other metadata of the host
+ running the container manager, if this is considered desirable, please parse
+ the host's `/etc/os-release` and set a `$container_host_<key>=<VALUE>`
+ environment variable for the ID fields described by the [os-release
+ interface](https://www.freedesktop.org/software/systemd/man/os-release.html), eg:
+ `$container_host_id=debian`
+ `$container_host_build_id=2020-06-15`
+ `$container_host_variant_id=server`
+ `$container_host_version_id=10`
+
## Advanced Integration
1. Consider syncing `/etc/localtime` from the host file system into the