libpod: use /var/run instead of /run on FreeBSD

This changes /run to /var/run for .containerenv and secrets in FreeBSD
containers for consistency with FreeBSD path conventions. Running Linux
containers on FreeBSD hosts continue to use /run for compatibility.

[NO NEW TESTS NEEDED]

Signed-off-by: Doug Rabson <dfr@rabson.org>
This commit is contained in:
Doug Rabson
2023-08-17 14:04:23 +01:00
parent e0b8178ad0
commit 27b41f0877
9 changed files with 87 additions and 15 deletions

View File

@ -26,7 +26,9 @@ Secret Options
- `target=target` : Target of secret.
For mounted secrets, this is the path to the secret inside the container.
If a fully qualified path is provided, the secret is mounted at that location.
Otherwise, the secret is mounted to `/run/secrets/target`.
Otherwise, the secret is mounted to
`/run/secrets/target` for linux containers or
`/var/run/secrets/target` for freebsd containers.
If the target is not set, the secret is mounted to `/run/secrets/secretname` by default.
For env secrets, this is the environment variable key. Defaults to `secretname`.
- `uid=0` : UID of secret. Defaults to 0. Mount secret type only.

View File

@ -28,7 +28,8 @@ These will be based on the host's version of the files, though they can be
customized with options (for example, **--dns** will override the host's DNS
servers in the created _resolv.conf_). Additionally, a container environment
file is created in each container to indicate to programs they are running in a
container. This file is located at _/run/.containerenv_. When using the
container. This file is located at _/run/.containerenv_ (or
_/var/run/.containerenv_ for FreeBSD containers). When using the
--privileged flag the .containerenv contains name/value pairs indicating the
container engine version, whether the engine is running in rootless mode, the
container name and ID, as well as the image name and ID that the container is based on. Note: _/run/.containerenv_ will not be created when a volume is mounted on /run.