Install Docker onto ZFS Filesystem

  • before you move docker root to zfs do some googling and check out, if it works.

    I remember there had been issues with that.

    Is zfs now supported officially?

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    I remember there had been issues with that.

    Is zfs now supported officially

    Yes, there is a zfs storage driver, I was helping a user some time ago and we assumed the issue was related to docker on zfs, turned out to be something else, I have just installed docker on my test VM;

  • Thanks for testing it out. Looks like the zfs storage driver creates a file system for each layer in the image.

    Wait until you have some more containers running. There will be gazillions of fs.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    s there any way that the legacy filesystem can be hidden in the zfs GUI

    zfs filesystems only show up if they are imported. I will have to see what docker does but I think Zoki is right and there will be many.

    omv 7.1.0-2 sandworm | 64 bit | 6.8 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.13 | compose 7.2 | k8s 7.1.0-3 | cputemp 7.0.1 | mergerfs 7.0.5 | scripts 7.0.7


    omv-extras.org plugins source code and issue tracker - github - changelogs


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • I also tested it in my test environment and I'm getting the same response.

    I created a separate filesystem off of my zfs pool Pool1/Docker, installed Docker and confirmed it appeared on that filesystem.

    I then installed Yacht and it created 16 legacy filesystems which appear on the zfs/Pools tab. That's unfortunate...


    These file systems do not show up on the zfs filesystem from what I can see, at least not under /Pools1. The only entries I see are /Backups and /Docker, the two filesystems I created.


    So what your telling me is I need to install Docker on another drive somewhere? Or is this just an interface issue under OMV6?


    I'm not sure I have room in this box for anymore drives, maybe one, but then I won't have any redundancy... Unless there's a way to back up my Dockers to my zfs /Backups volume?


    Thanks,

  • Maybe it helps to force docker to use the overlay2 storage drive and not let it autodetect.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

    • Offizieller Beitrag

    Or is this just an interface issue under OMV6

    No, nothing to do with OMV, do a search for legacy filesystems on zfs after installing docker, as soon as tried this on my test VM I remembered why I went down adding another drive for docker and container configs.

    • Offizieller Beitrag

    Docker has excellent docs

    I agree, and having found an article that suggests using another storage driver, I've just tested that following the link and adding the storage driver to the daemon json file, but unfortunately this doesn't work as docker still uses the zfs storage driver

  • I already found that document, however I don't understand the following instructions..


    "If you want to use a separate backing filesystem from the one used by /var/lib/, format the filesystem and mount it into /var/lib/docker. Make sure add this mount to /etc/fstab to make it permanent."


    It appears that even though I specified /Pool1/Docker for the Docker storage, which is my zfs filesystem, it still installed the same file structure in the /var/lib/docker folder with the addition of a overlay2 folder. There are no containers in this structure, they are in /Pool1/Docker.


    It looks like it's using /var/lib/docker for its install and /Pool1/Docker for storing containers?

  • Too bad, so OP has no other chance than fitting another drive in his case.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • you can format a ZFS volume as ext4 to workaround this issue.

    Former Xpenology user moved to OMV 7.x with ZFS.

    HP Microserver Gen8 - 16GB RAM - 1x 32GB USB - 1x 480 GB SSD - 4x 16TB Exos (Shucked) / ZFS - OMV 7.x bare metal

    HP Microserver Gen7 N54L - 8GB RAM - 1x 32GB USB - 1x 240 GB SSD - 4x 4TB / ZFS - OMV 7.x bare metal


  • They use /var/lib/docker as synonym for the docker-root. You can either mount a different file system to /var/lib/docker or move it by changing /etc/docker/daemon.json (which you did using the plugin).


    What you see in /var/lib/docker is what has been placed there in the initial docker install before you moved it to your pool.

    If you got help in the forum and want to give something back to the project click here (omv) or here (scroll down) (plugins) and write up your solution for others.

  • They use /var/lib/docker as synonym for the docker-root. You can either mount a different file system to /var/lib/docker or move it by changing /etc/docker/daemon.json (which you did using the plugin).


    What you see in /var/lib/docker is what has been placed there in the initial docker install before you moved it to your pool.

    OK, well that makes sense.


    So the bit about using the overlay2 driver implies using an ext4 partition?


    It appears as soon as you move the install to a zfs volume it switches to using a zfs driver.


    All of my drives are part of zfs Pool1. Can I create a separate filesystem off of that and format it as ext4? if so, how?


    Thanks,

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!