-------- Forwarded Message -------- Subject: Re: Btrfs and nspawn Date: Sun, 28 Sep 2025 05:48:04 -0400 From: Pocket <pocket@columbus.rr.com> To: Moabeat <moabeat@berlin.de> On 9/28/25 2:45 AM, Moabeat wrote:
Let me check if I understood this correctly:
1. You want to set up a container for prividing DNS services. 2. You want this setup of DNS to persist between container restarts. 3. You want the container to keep up with the system updates of your host system.
Yes that is correct.
Maybe it dind't get the point of what you try to achieve, but for me this raises the question why you want to use a container at all? IMHO the best option would be, to just install the packages for the DNS services right away in your host, configure them and ditch the container. The whole point of a container is, that it can be run and updated independently of the host. Or is there anything I missed?
I am doing this already on a host that uses ext4 for the filesystem and I wish to change that to btrfs. By using a container (systemd-nspawn) it allows me to keep the service separate from the host system. I then can copy that to move the container to another host without trouble. I am doing this on a single host that has containers for DNS, Nginx and dovecot/opensmtpd. I want to snapshot the "root" subvolume as the starting point for the container. If I understand the process the I won't have to "install" the "rootsystem" in each container and they will share those files. The only differences will be whatever changes need to be made for each container saving a bunch of SDD space. When setting up the "subvolumes/containers" for each service if I use the --template option it appears to do that but it is voltile as it will setup a new subvolume each time that will a "copy" of the the root subvolume, without bind and settings. I originally though I could do this by snapshotting the "root" subvolume and then use that for the systemd-nspawn container starting it with machinectl upon system boot. I have not tried that. I am asking if anyone here has done something like this. Looking for pointers information.
On Sun Sep 28, 2025 at 2:24 AM CEST, Pocket wrote:
I have a system that uses btrfs for the root filesystem.
I created a subvolume root which becomes the root filesystem on boot up, ie it bootds to the root subvolume.
I now want to add some "containers" to that machine, for example DNS.
When set up with bind and started with machinectl provides DNS for the network.
Is it possible to use a snapshot for the root subvolume for nspawn containers?
I have seen that one can use the --template option but it appears to be a newly created container every time.
Thsat won't work as I would lose the bind setup.
I need something that is not volatile in which I can install bind an configure it without having to do that every time the container is shutdown and the restarted.
Also if I can use the root subvolume as a template will the subsequent containers be updated when I use pacman -Syu to update the root subvolume?
-- Hindi madali ang maging ako
Hi, imho you should look into Docker and the likes, there's no point in reinventing containerization and maintaining your own Containers/root images when you can just use ready made ones from docker hub e.g. -- Georg
On 9/28/25 6:34 AM, Georg Pfahler wrote:
Hi,
imho you should look into Docker and the likes, there's no point in reinventing containerization and maintaining your own Containers/root images when you can just use ready made ones from docker hub e.g.
I don't do docker -- Hindi madali ang maging ako
You may not have a choice in the matter, Docker is the standard for this stuff for a reason... -Adam ________________________________ From: Pocket <pocket@columbus.rr.com> Sent: 28 September 2025 12:06 To: arch-general@lists.archlinux.org <arch-general@lists.archlinux.org> Subject: Re: Btrfs and nspawn On 9/28/25 6:34 AM, Georg Pfahler wrote:
Hi,
imho you should look into Docker and the likes, there's no point in reinventing containerization and maintaining your own Containers/root images when you can just use ready made ones from docker hub e.g.
I don't do docker -- Hindi madali ang maging ako
You can also use Podman if you hate Docker that much. Kind regards Julian On September 28, 2025 2:28:33 PM GMT+02:00, Adam Tazul <adam_tazul@outlook.com> wrote:
You may not have a choice in the matter, Docker is the standard for this stuff for a reason...
-Adam
________________________________ From: Pocket <pocket@columbus.rr.com> Sent: 28 September 2025 12:06 To: arch-general@lists.archlinux.org <arch-general@lists.archlinux.org> Subject: Re: Btrfs and nspawn
On 9/28/25 6:34 AM, Georg Pfahler wrote:
Hi,
imho you should look into Docker and the likes, there's no point in reinventing containerization and maintaining your own Containers/root images when you can just use ready made ones from docker hub e.g.
I don't do docker
-- Hindi madali ang maging ako
participants (4)
-
Adam Tazul
-
CraftingDragon007
-
Georg Pfahler
-
Pocket