Open question: Podman and user/group IDs


Here is an open question for Podman users: is there a (ideally simple) way to keep the user/group ID between the real system and the container?

Let me be more verbose.

I use Docker mostly in two "special" cases:

  • As Yocto build environment: I can use whatever the people I work with/Yocto version wants.
  • For creating developer environments: I create Docker containers that have the same environments as the CI docker instances I use with GitLab + development tools I run sharing the X socket. In that way the people I work with can reuse the same environment and have the exact same set of tools, without the inconveniences of virtual machines.

Now in both setups I mount some system directory into the chroot, normally as $HOME. Using Docker I can do the right UID/GID mapping and any file I create inside the container will have my system's UID/GID. And that's the thing I so far could not do with Podman.

So dear Podman user: is there any way to do this with Podman? If you know, please feel free to send a comment/email!

Comments


  • Avatar
    Permalink

    Jerome

    Posted on

    Hi,

    I've also been using Docker to develop in a controlled environment while using my home directory. To use podman and solve the issue you have I just had to add the "--userns=keep-id" option to my "docker run" command. This makes sure that files belonging to you on the host do not appear as owned by root in the container (default), but keep your ownership.


    • Avatar
      Permalink

      Lisandro Damián Nicanor Pérez Meyer

      Posted on

      Thanks a lot Jerome! Also to A. Terceiro who contacted me on IRC!

Add a Comment

You can use the Markdown syntax to format your comment.

Comment Atom Feed