RSS 피드 구독하기

Back in November, we wrote Rootless Podman on NFS, which explained why you cannot use the default setup of Podman when running with an NFS home directory. Since then, we have made it easier with newer versions of Podman and have discovered some issues with users setting up these environments.

Currently, rootless Podman (by default) stores its container image content in the user’s home directory. The blog linked above explains that Podman is blocked from using multiple UIDs on the NFS server side since the NFS server does not understand user namespace. The blog recommends that the user set up a different directory for storing content. Users need to edit the storage.conf file to make that happen.

About rootless_storage_path

We have added a new option field to storage.conf named rootless_storage_path to make it easier to use rootless Podman on an NFS home directory for different users.

$ man containers-storage.conf

       rootless_storage_path="$HOME/.local/share/containers/storage"

       Storage path for rootless users. By default, the graphroot for rootless users is set to $XDG_DATA_HOME/containers/storage, if XDG_DATA_HOME is set. Otherwise, $HOME/.local/share/containers/storage is used. This field can be used if administrators need to change the storage location for all users.

              The rootless storage path supports three substations:
              * `$HOME` => Replaced by the users home directory.
              * `$UID`  => Replaced by the users UID
              * `$USER` => Replaced by the users name

A common use case for this field is to provide a local storage directory when user home directories are NFS-mounted (podman does not support container storage over NFS).

This feature lets an administrator set up a machine with NFS home directories point the user’s container content to a separate directory.

For example, see the following setting:

rootless_storage_path="$/var/lib/user/$USER/containers/storage"

If the user sally executed Podman as a normal user, Podman would attempt to create the directories /var/lib/user/sally/containers/storage, and store the container images in that directory. It would also use these directories for all other containers. If ralph logged into the same machine and executed Podman, his storage would be /var/lib/user/ralph/containers/storage. Obviously, these directories would need to pre-exist and be writable by the respective user. The administrator could set up the parent directories, /var/lib/users, to be world-writable, and the Podman command would create the entire path.

Now, this leads me to my second point for this blog.

Using tmp directories for container storage

Administrators may be tempted to use /tmp or /var/tmp as container storage directories. Well, some of our users have reported problems when using these directories. The users reported that random files/directories disappeared from their images and containers. We diagnosed the problem and figured out that systemd was doing tmpfile cleanup. Systemd periodically triggers a job to clean up old content left in temporary directories. This job was erasing older files and directories stored in container-storage. The systemd-tmpfiles does not know about these Podman directories - it just does its job.

Wrap up

The bottom line is that if an administrator wants to store his content in /var/tmp or /tmp, they need to modify the systemd-tmpfiles to ignore the container content directories. Finally, on RHEL, CentOS, and Fedora, as well as many other distributions, the /tmp is on a tmpfs, which by default is only allowed to store up to 50% the size of memory, and will be destroyed on reboot.

[ Getting started with containers? Check out this free course: Deploying containerized applications: A technical overview. ]


저자 소개

Daniel Walsh has worked in the computer security field for over 30 years. Dan is a Senior Distinguished Engineer at Red Hat. He joined Red Hat in August 2001. Dan leads the Red Hat Container Engineering team since August 2013, but has been working on container technology for several years. 

Dan helped developed sVirt, Secure Virtualization as well as the SELinux Sandbox back in RHEL6 an early desktop container tool. Previously, Dan worked Netect/Bindview's on Vulnerability Assessment Products and at Digital Equipment Corporation working on the Athena Project, AltaVista Firewall/Tunnel (VPN) Products. Dan has a BA in Mathematics from the College of the Holy Cross and a MS in Computer Science from Worcester Polytechnic Institute.

Read full bio

I am an engineer in the containers engine team at Red Hat. I have a passion for container-related projects, where I started my career, and contribute to projects like Podman and Skopeo.

Read full bio
UI_Icon-Red_Hat-Close-A-Black-RGB

채널별 검색

automation icon

오토메이션

기술, 팀, 인프라를 위한 IT 자동화 최신 동향

AI icon

인공지능

고객이 어디서나 AI 워크로드를 실행할 수 있도록 지원하는 플랫폼 업데이트

open hybrid cloud icon

오픈 하이브리드 클라우드

하이브리드 클라우드로 더욱 유연한 미래를 구축하는 방법을 알아보세요

security icon

보안

환경과 기술 전반에 걸쳐 리스크를 감소하는 방법에 대한 최신 정보

edge icon

엣지 컴퓨팅

엣지에서의 운영을 단순화하는 플랫폼 업데이트

Infrastructure icon

인프라

세계적으로 인정받은 기업용 Linux 플랫폼에 대한 최신 정보

application development icon

애플리케이션

복잡한 애플리케이션에 대한 솔루션 더 보기

Virtualization icon

가상화

온프레미스와 클라우드 환경에서 워크로드를 유연하게 운영하기 위한 엔터프라이즈 가상화의 미래