podman
podman
¶
Podman helpers shared by the terok packages.
Exposes helpers that spell podman arguments correctly for the host's podman release: user-namespace mapping for rootless invocations and the force-pull flag for image builds.
__all__ = ['podman_pull_always_args', 'podman_userns_args']
module-attribute
¶
podman_userns_args()
¶
Return user namespace args for rootless podman so UID 1000 maps correctly.
Maps the host user to container UID/GID 1000, the conventional non-root
dev user in terok container images. Returns an empty list when
running as root — root podman runs in the host user namespace and
has no need to remap.
Podman releases older than 4.3 predate the keep-id:uid=…
customization; for those the same mapping is spelled out as explicit
--uidmap/--gidmap triples, assuming the standard 65536-ID
subordinate allotment.
Source code in src/terok_util/podman.py
podman_pull_always_args()
¶
Return the podman build flags that force re-pulling base images.
Podman 4.0 turned --pull into a policy option (--pull=always);
older releases take --pull as a boolean and reject the policy
form outright, spelling the same request --pull-always instead.