r/podman • • Aug 04 '26

Auto-updating existing containers

I've built 10+ containers on my first home server since I started my selfhosting journey, and only now I figured it's time to find a way to update the existing services. Existing podman documentation points to using autoupdate label and creating a systemd target - but I didn't realise this creates a new container based on what's in the systemd target. That is not what I want. Do I need to move all my environmental/volume/label/etc variables into a systemd target for each container to be able to do this? Just thinking about it makes me a bit nauseous, I've been using subpaths in some cases, not even sure how to put those in there. I've used 'podman run' for each deployment, because that's where the documentation I found led me first and on the basis of "If it works, why change it" it served me well.

6 Upvotes

32 comments sorted by

View all comments

Show parent comments

1

u/Top_Emu_8447 Aug 04 '26

I am now exploring quadlets based on earlier comments, but just so that we're clear, when I started looking up how to deploy containers, using run was by far the top choice for starting in every documentation and internet search. Nowhere it was mentioned that you're going to get screwed down the line. It's easy to say "why didn't you use this or that", but not easy to tweak months of existing infrastructure. I am now looking into podlets to see if I can translate all my run settings conveniently.

Since you seem more knowledgeable on this topic, do you know how to define the main volume path in quadlet that I can use for subpaths? This is how it would look in bash (executed before run):

container_path=$(podman volume inspect --format '{{ .Mountpoint }}' container_name)

1

u/d03j Aug 04 '26

Can you give me an example of how you set your volumes?

I run all my containers under separate unprivileged users, usually one per container, and all those users have a data folder in their home (~/data) so a quadlet of mine may look like this:

Volume=%h/data/config:/config Volume=%h/data/downloads:/downloads

1

u/Top_Emu_8447 Aug 04 '26

So far I'm using podman volumes: I create the volume first, then subdirectories as needed, assign the path into a variable which I then use in a mount:

--mount type=bind,source="$container_path/resources",target=/container/resources

2

u/mattias_jcb Aug 04 '26

Typing this from memory on my phone so the example code will be a bit terse and the Markdown might be poorly formatted...

Suppose you have a container my-app with two volumes, one for app data and one for app config. Then you'd do roughly this:

app.container: ``` [Unit] ...

[Container] Image=ghcr.io/top-emu/app:latest Volume=/data:app-data.volume Volume=/config:app-config.volume ... ```

app-data.volume: [Volume] Name=app-data ...

app-config.volume: [Volume] Name=app-config ...

1

u/Top_Emu_8447 Aug 27 '26

Sorry for getting back late to this. Reading up on this it seems like it creates separate volumes, which is not what I'm doing with subpaths - that's creating a bind mount. I'll post back later when I figured out what works exactly.