Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

A reported rootless podman export produced a tar archive in which file owners appeared shifted, even though the command returned exit status 0. That is a case report, not a documented rule for every Podman release or setup. Rootless user-namespace mappings explain why container IDs and host IDs can differ, but Podman’s export documentation does not promise that archive owner IDs are normalized to the invoking user.

What does a successful export with shifted owners mean?

podman export writes a container’s filesystem to a tar archive and flattens it into one layer. In the reported case, the command returned 0 while the archive’s owner IDs differed from the expected values. A zero exit status reports that the command did not signal failure through that status; it does not establish that the tar headers contain the ownership values you intended.

The report does not establish a Podman version, host configuration, exact namespace mapping, or independently verified archive metadata. The official podman-export reference defines the export operation but does not document an owner-ID conversion guarantee. Treat the shift as something to diagnose in your environment, not as universal behavior.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why keep-id does not guarantee host-style archive owners

Rootless Podman runs containers in a user namespace. Numeric IDs inside that namespace can correspond to different IDs on the host, depending on the mapping and subordinate UID/GID ranges. Podman’s v6.1.3 run manual describes --userns=keep-id as mapping the invoking user’s UID and GID to the same values inside the container; optional uid= and gid= values can select container IDs. Unless overridden with --user, the container’s init process runs under that mapped identity.

This describes a namespace mapping, not a promise about how a later export command writes ownership into tar headers. The rootless tutorial also distinguishes the identity visible inside the container from the host IDs used by the namespace. The name keep-id should not be read as “rewrite every archived file owner to the host user.”

First distinguish the artifact you need

Command What it archives Relevant distinction
podman export The container filesystem as a flattened tar archive. Use when you need the container filesystem. The reference does not state an owner-ID normalization guarantee.
podman save An image archive that retains image layers, history, and tags. Use when you need to archive or transfer an image. It is not a drop-in replacement for exporting a container’s filesystem.

These semantics are described in the Podman export documentation. Choose based on whether the required object is a container filesystem or an image; changing commands alone does not establish that the resulting ownership metadata will match a particular expectation.

How to verify where the IDs change

Compare numeric IDs at each stage instead of relying on owner names. Names shown by ls are resolved using account databases and can obscure differences in the underlying UID or GID.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  1. Record the environment. Capture podman version, the host UID/GID, whether Podman is rootless, and the relevant /etc/subuid and /etc/subgid ranges.
  2. Record the container mapping. Note whether keep-id uses its defaults or explicit uid=/gid= values. Inspect the effective mapping with podman inspect or podman unshare; where applicable, inspect /proc/self/uid_map and /proc/self/gid_map.
  3. Check ownership inside the container. Record numeric UID/GID values for the files in question, not only displayed user and group names.
  4. Inspect the tar headers. Compare the numeric UID/GID stored in the exported archive with the container-side values. This identifies whether the values differ in the artifact, rather than merely looking different in a host-side listing.
  5. Confirm the intended operation. If you need an image archive with layers and metadata, evaluate podman save; if you need the container filesystem, stay with the export path and investigate its archive headers.

This is a diagnostic workflow, not a claim that any particular release must produce a specific mapping in its tar output.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep volume ownership troubleshooting separate

Files created by rootless containers can appear on the host with subordinate UID/GID numbers. Podman’s troubleshooting guide describes using podman unshare to work with files under the user namespace and discusses keep-id:uid=...,gid=... for mapping the container identity to the invoking host user.

Those instructions address host-side files and volumes. They may help interpret or manage filesystem ownership, but they do not by themselves establish how podman export serializes owner IDs into a tar archive.

What is established—and what is not

  • Documented: Rootless containers use user-namespace mappings, and the same numeric UID/GID can have different meanings inside the container and on the host.
  • Documented: keep-id maps the invoking user into the container, with explicit container IDs available in the documented options.
  • Reported, not generalized: One practitioner case describes shifted owners in an exported tar and exit status 0. The full report was not retrievable, so its exact version and setup are not established.
  • Not documented in the export reference: A guarantee that exported tar ownership will be converted to host-user IDs, or a general explanation for the reported shift.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.