LXC containers vs. docker

  • IIRC, on OMV installing the compose plugin alone does not in install docker-ce. etc. It's only after you go through the compose settings page and save a config that the docker packages are installed. As you can specify the location of "Docker storage" at this stage, the content of the default location "/var/lib/docker" folder is written to the location specified in the settings. Hence, docker can be installed on ZFS in one step as I indicated in #17 above, to which you can add the output:


    Code
    root@omv7vm:~# cat /etc/docker/daemon.json
    {
      "data-root": "/pool2/dockersys"
    }
    root@omv7vm:~# 


    So the "/var/lib/docker" folder may never be installed on an EXT4 filesystem in the first case and it will be using the overlayfs storage driver.


    Installing docker to its default location on the system OS EXT4 filesystem and later moving the "/var/lib/docker" folder to a non-EXT4 system is a scenario I've not tested. But while you'd expect the "data-root" dir to change correctly in etc/docker/daemon.json, are all the files/dirs on the old "data-root" moved?

  • Installing docker to its default location on the system OS EXT4 filesystem and later moving the "/var/lib/docker" folder to a non-EXT4 system is a scenario I've not tested.

    I don't use ZFS, but just to expand on your statement about not testing moving docker storage to a non-EXT4 filesystem, I moved my docker storage from the OS EXT4 filesystem to an XFS filesystem years ago when I first started playing with docker on OMV (back in about OMV4) without issue.


    Of course, this is no shock as XFS is just a filesystem with a long history of native linux kernel support, while ZFS is a combination filesystem/raid amongst other things, and is newer to the linux world.

    Asrock B450M, AMD 5600G, 64GB RAM, 6 x 4TB RAID 5 array, 2 x 10TB RAID 1 array, 100GB SSD for OS, 1TB SSD for docker and VMs, 1TB external SSD for fsarchiver OS and docker data daily backups

    • Official Post

    IIRC, on OMV installing the compose plugin alone does not in install docker-ce. etc. It's only after you go through the compose settings page and save a config that the docker packages are installed. As you can specify the location of "Docker storage" at this stage, the content of the default location "/var/lib/docker" folder is written to the location specified in the settings.

    That depends on the order of setting the fields in the plugin GUI. The vast majority of users will start by configuring the first field, the compose folder, press the Save button and, without knowing it, they will have installed docker in the /var/lib/docker folder and it will be up and running. After that they will configure the docker folder field but at that point docker is already installed. This behavior may change in the future if ryecoaaron modifies it but it remains an unknown.

    Someone could even be running docker on EXT4 and after that decide to switch to ZFSor BTRFS. If that is the case, should the user manually modify the docker driver?

    I would really like to know if that is going to work or not, just to explain it on the wiki. Since it seems like you don't know, I'll try if I find the time, but it won't be soon. In any case, I will maintain in the wiki the recommendation to use EXT4 as recommended in the Docker documentation, I think it is the most prudent.

  • Someone could even be running docker on EXT4 and after that decide to switch to ZFSor BTRFS. If that is the case, should the user manually modify the docker driver?

    They don't have to if using ZFS version >= 2.2.0. I believe docker on BTRFS has defaulted to overlayfs since about docker 23, so no need to change the storage driver. I'm sure you can find relevant discussion of r/zfs and r/btrfs.

    • Official Post

    They don't have to if using ZFS version >= 2.2.0. I believe docker on BTRFS has defaulted to overlayfs since about docker 23, so no need to change the storage driver. I'm sure you can find relevant discussion of r/zfs and r/btrfs.

    If I am understanding correctly what you are saying is that after a change from EXT4 to ZFS in the /var/lib/docker folder docker would work without any additional action if the ZFS version is equal to or greater than 2.2.0. You also say that BTRFS can work with the overlay2 driver (overlayfs?). However the docker documentation states that overlay2 is only compatible with XFS and EXT4. See here -> https://docs.docker.com/engine…orted-backing-filesystems

  • In the interest of science, I will setup my system disk as zfs and then install docker clean/new on this drive. 😂😂


    I will let you know how I get on.


    My minipc has arrived from china and should be delivered tomorrow

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • jata1 I hope the new minpc lives up to expectations. To clarify, OMV OS device defaults to EXT4. You need at least one additional device to get docker on a non-EXT4 filesystem.


    If I am understanding correctly what you are saying is that after a change from EXT4 to ZFS in the /var/lib/docker folder docker would work without any additional action if the ZFS version is equal to or greater than 2.2.0. You also say that BTRFS can work with the overlay2 driver (overlayfs?). However the docker documentation states that overlay2 is only compatible with ZFS and EXT4. See here -> https://docs.docker.com/engine/storage/drivers/select-storage-driver/#supported-backing-filesystem

    You perhaps meant XFS and EXT4 in your last sentence. This is clearly a case where docker docs are out of date and at odds with other docs (even their own at https://docs.docker.com/engine/release-notes/23.0/) and practical experience.


    An example of docker on BTRFS:


  • Krisbee - understood regarding os disk and not using zfs. No problem!


    chente -


    installed OMV os on internal m.2 sata slot (formatted ext4)

    then installed proxmox kernel

    then installed zfs plugin

    then created zfs pool (basic) for system disk using the other internal slot m.2 nvme

    then docker installed on zfs pool


    then copied across all of my docker persistent data to the zfs

    checked and updated all the docker mappings/configs

    done & beer.


    Everything running great. No errors. Performance is great. Overall this is a big upgrade over my rpi5 8gb.

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • Will monitor for a while. Keeping my rpi5 online but dedicated to all my home automation (home assistant etc) stuff.


    Have found one issue but not with any of the above config (maybe it is my lack of understanding of zfs). I added a new/formatted usb ssd disk to the minipc but I can't add another new pool - the new device is not shown in the dropdown. Any suggestions?

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • crashtest. Yes I do backup. Basically everything using rsync to offsite server.


    Both prod and backup data storage using multi disk btrfs so I’m good.

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • zfs experiment is over in any case. Decided to delete the disk and setup as ext4 as I don't have a need for zfs on this single disk. And this is my prod server so stability is important to me.


    All worked fine using zfs by the way - so i guess it is an option - but only really makes sense if you have more than one disk (and they are not USB).

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • Agreed. The disk i used for testing was not usb. It was an internal (pcie i think) m.2 nvme. But all the same, ext4 is the way to go for this type of use - together with a good backup strategy.


    And I am very happy with my $200 ($120 US) minipc. It's a GMKtec G3. It totally kills my rpi5 and I paid less for it too.

    OMV 8 (latest) on N100 minipc (16GB) and rpi5 (8GB). OS on SSD/SD. System ext4 on SSD. Data BTRFS on HDDs

  • jata1

    Added the Label resolved
    • Official Post

    You perhaps meant XFS and EXT4 in your last sentence. This is clearly a case where docker docs are out of date and at odds with other docs (even their own at https://docs.docker.com/engine/release-notes/23.0/) and practical experience.

    Yes, it was a typographical error, it has been corrected, thank you.


    I guess you're right, there may be contradictions in the docker documentation. I think you are referring to this specifically. https://docs.docker.com/engine…-fixes-and-enhancements-6


    I hope they stop discouraging ZFS and BTRFS on production systems soon. In the meantime I will keep the docker wiki on omv-extras as is to avoid problems.

    I'm glad this works apparently without problems, that's good news. Thanks for the effort to try it.

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!