buildroot: set container env variable

Set the container environment variable to indicate to programs
inside the build root that they are indeed running inside a
container (see also https://systemd.io/CONTAINER_INTERFACE/).
This commit is contained in:
Christian Kellner 2021-12-08 11:12:55 +00:00
parent 0c71289067
commit c825c7e4fa
2 changed files with 2 additions and 0 deletions

View file

@ -275,6 +275,7 @@ class BuildRoot(contextlib.AbstractContextManager):
# Setup a new environment for the container.
env = {
"container": "bwrap-osbuild",
"LC_CTYPE": "C.UTF-8",
"PATH": "/usr/sbin:/usr/bin",
"PYTHONPATH": "/run/osbuild/lib",

View file

@ -214,6 +214,7 @@ def test_env_isolation(tempdir):
allowed = [
"_", # added by `env` itself
"container",
"LC_CTYPE",
"PATH",
"PWD",