Podman and persistent container

I'm running a podman container which vanishes after reboot. I have to pull the image and create the container from scratch.
How can I make sure it will stay persistently on the file system. As I'm running x86 disk storage is not my concern.

This is how the container mounts currently look like:

tmpfs on /tmp/lib/containers/storage/overlay type tmpfs (rw,nosuid,nodev,noatime)
shm on /tmp/lib/containers/storage/overlay-containers/04e10c3fad8353292ff52cc2c84dffdfca8f742f839334991a613b5ea23950cf/userdata/shm type tmpfs (rw,nosuid,nodev,noexec,relatime,size=64000k)
overlay on /tmp/lib/containers/storage/overlay/d30eb932a113659c8c5600aa9159de42f9461621923e756d3971c8bdf8e1c35c/merged type overlay (rw,nodev,relatime,lowerdir=/var/lib/containers/storage/overlay/l/2TP34ZRHXIMWQF4FHGLNYR4AXT:/var/lib/containers/storage/overlay/l/LHMQY6BDFUTU6NYDIBHPHWMWX5:/var/lib/containers/storage/overlay/l/AMC2A7JYR4JHM3PYDA5QTUQIQM,upperdir=/var/lib/containers/storage/overlay/d30eb932a113659c8c5600aa9159de42f9461621923e756d3971c8bdf8e1c35c/diff,workdir=/var/lib/containers/storage/overlay/d30eb932a113659c8c5600aa9159de42f9461621923e756d3971c8bdf8e1c35c/work)

/tmp is ram, whatever you store there is lost during reboot.

1 Like

But why does it go into /tmp?
This is /etc/containers/storage.conf excerpt:

[storage]

# Default Storage Driver, Must be set for proper operation.
driver = "overlay"
runroot = "/run/containers/storage"
graphroot = "/var/lib/containers/storage"

Ok well I found out this: Persistent /var
I will try if I can switch to some other directory than /var then...

The moment I try to set graphroot to a persistent storage I'm getting this error:

[2023-11-14 10:49:21] ERROR server start failed: start udp listener failed: listen udp :53: bind: permission denied

It seems I will either have to compile my own image where /var is persistent or I will have to modify my procd script so it will create the container each time from scratch. Both I kind of dislike.

that error doesn't appear to be related to the container location ...

It's weird. I've now built my own image with Imagebuilder and used the

TARGET_ROOTFS_PERSIST_VAR=y

and my containers are still on /tmp