Docker Stacks

    • Official Post

    This might be another good example of why using Symlinks in docker is a pretty good idea. Since UUID's can change on a new install, it could put OP back in this situation (although now he'd be wise to it). With Symlinks, you can keep them consistent across new installs, you just have to create your links before installing docker. That's what I did when I clean installed 6 earlier this month and it actually worked very well. In my situation, all of my "/config" directories (or in the case of Portainer, /data), are under /NAS/AppData. All of my Media, is under /NAS/Media... This makes setting up my symlinks from memory easy, and also if I want to install new containers, my paths are easy to set from memory. I've got a few other paths I link outside of AppData and Media, but since I know them and know they are consistent.. it's quite easy.


    Just something to think about.

    • Official Post

    Good post KM0201. For some time I have been thinking about streamlining, simplifying, and standardizing my servers. This makes them easier to maintain, rebuild, and upgrade. Symlinks certainly play a big part in all of this, along with proper setup of shared folders and docker/Portainer. Your Portainer yml in the second post of this thread was one of the last pieces I have been looking for.


    I have worked a lot if this into my setup already but I plan to rework the whole thing when I migrate to OMV6. I’m a zip-tie kind of guy. :)

    Thanks for the post.

    System Backup Typo alert: Under the Linux section the command should be sudo umount /dev/sda1 NOT sudo unmount /dev/sda1

    Backup Data Disk to Backup Disk on Same Machine: In a Scheduled Job:rsync -av --delete /srv/dev-disk-by-uuid-f8814ed9-9a5c-4e1c-8830-426968c20ea3/ /srv/dev-disk-by-uuid-e67439d5-00a3-4942-bd5f-b84ab86aa850/ Don't forget trailing slashes, and BE CAREFUL. (HT: Getting Started with OMV5)

    Equipment - Thinkserver TS140, NanoPi M4 (v.1), Odroid XU4 (Using DietPi): PiHole

    • Official Post

    Good post KM0201. For some time I have been thinking about streamlining, simplifying, and standardizing my servers. This makes them easier to maintain, rebuild, and upgrade. Symlinks certainly play a big part in all of this, along with proper setup of shared folders and docker/Portainer. Your Portainer yml in the second post of this thread was one of the last pieces I have been looking for.


    I have worked a lot if this into my setup already but I plan to rework the whole thing when I migrate to OMV6. I’m a zip-tie kind of guy. :)

    Thanks for the post.

    Thanks. I moved to Symlinks in OMV 5 and it worked well. I had quite a bit of time in setting up my containers how I wanted them in OMV 5 and wanted to avoid completely redoing them in OMV 6.. I tested, retested etc. doing clean installs with Symlinks in Virtualbox multiple times so if there were any hiccups, I'd know... It honestly went super smooth... the real key I found, is doing things in the proper order.


    1. Clean install OMV

    2. Create shares, users, etc.

    3. Install symlinks plugin and set up your links (or do it manually.. they're dead nuts simple to do)

    4. Install docker. Assuming you're using your "old" containers folder that has all your volumes, etc. from the previous install.... As soon as docker finishes installing and starts.. Just log in to Portainer (if you have a /data folder, your username password will be the same).. and any anything you've done in Portainer (stacks, etc.) will be just as before.


    It was one of the easiest clean installs/upgrades I ever done. The real key in this is creating your symlinks before installing docker. If you install docker first, it's going to create a bunch of paths going nowhere, like it did for the OP. I've seen some folks put their symlinks under /srv somewhere. Really 2 reasons I opted to put them under a custom location (ie, /NAS). First is that that /srv folder is gonna get pretty crowded, pretty quick and might get confusing at the command line level. Second, it was an easy path to remember that I could keep consistent between my two servers.


    It really has made docker way way easier to manage, IMO. If your links, and containers pointing at them, are set up properly there's no risk of filling up your OS drive if you've got a small OS drive.

  • This might be another good example of why using Symlinks in docker is a pretty good idea. Since UUID's can change on a new install, it could put OP back in this situation (although now he'd be wise to it). With Symlinks, you can keep them consistent across new installs, you just have to create your links before installing docker. That's what I did when I clean installed 6 earlier this month and it actually worked very well. In my situation, all of my "/config" directories (or in the case of Portainer, /data), are under /NAS/AppData. All of my Media, is under /NAS/Media... This makes setting up my symlinks from memory easy, and also if I want to install new containers, my paths are easy to set from memory. I've got a few other paths I link outside of AppData and Media, but since I know them and know they are consistent.. it's quite easy.

    I'm still slightly confused with the setup. If I understand correctly (notwithstanding the order):


    1) Docker installed on a separate external drive


    2) Portainer plus all containers on another drive (i.e. /config files) - which is backed up onto another external drive, in case the first drive goes down


    3) Symlinks to make it easier to navigate and get No. 2 working irrespective of their UUIDs

    • Official Post

    Correct.


    Example..


    Code
    ken@openmediavault:/NAS$ ls -l
    total 20
    lrwxrwxrwx 1 root root 66 Jan 13 16:32 AppData -> /srv/dev-disk-by-uuid-408aa422-44c0-40d4-8e38-5c1f5ee1a56b/AppData
    lrwxrwxrwx 1 root root 71 Jan 13 16:33 Data -> /srv/dev-disk-by-uuid-408aa422-44c0-40d4-8e38-5c1f5ee1a56b/Disk_1/Data/
    lrwxrwxrwx 1 root root 64 Jan 13 16:34 Home -> /srv/dev-disk-by-uuid-408aa422-44c0-40d4-8e38-5c1f5ee1a56b/Home/
    lrwxrwxrwx 1 root root 71 Jan 13 16:34 Media -> /srv/dev-disk-by-uuid-408aa422-44c0-40d4-8e38-5c1f5ee1a56b/Disk_1/Media
    lrwxrwxrwx 1 root root 68 Jan 13 16:33 Torrents -> /srv/dev-disk-by-uuid-408aa422-44c0-40d4-8e38-5c1f5ee1a56b/Torrents/
    ken@openmediavault:/NAS$ 

    If you look, you can see where the respective links (under NAS).. are pointed at (somewhere on/srv) by the ->.. Then I just use the link location in my docker-compose/stacks.


    A couple examples (note the volume locations).. In the event I have to reinstall.. I create my symlinks (as noted below) from my data folders that are under /srv somewhere.. then install docker and point it at my containers folder... and basically docker starts up like nothing happened.


    Hopefully that is clear.


  • Just one thing to remember: If we talk about setting the correct permissions, you have to set them on the original directory, not the link.

    i.e. the directory in /srv/dev-disk-by-..../....

    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.

  • Not tying to hijack the thread, but trying to understand as I am installing docker and portainer myself under OMV 6.

    Why the separation of Docker and Portainer?


    1) Docker installed on a separate external drive

    2) Portainer plus all containers on another drive


    Why not install all of these on one drive (for instance the /DATA drive)?

    • Official Post

    Not tying to hijack the thread, but trying to understand as I am installing docker and portainer myself under OMV 6.

    Why the separation of Docker and Portainer?


    1) Docker installed on a separate external drive

    2) Portainer plus all containers on another drive


    Why not install all of these on one drive (for instance the /DATA drive)?

    Look here. It can clear up some ideas for you.


    I don't see the reason to separate docker in one unit and containers in another unit, it can be the same, but it is advisable to separate it from the OS.

    As for locating this on the data drive, just be careful about the disk format of this drive. Mergerfs for example can cause problems. An EXT4-formatted standalone drive is the error-free solution.

  • 1) Docker installed on a separate external drive

    2) Portainer plus all containers on another drive


    Why not install all of these on one drive (for instance the /DATA drive)?

    No need to have this on separate disks, read the giud. You have on directory for docker-root and one for the containers, they may well be on the same disk, but not on a mergerfs

    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.

  • No need to have this on separate disks, read the giud. You have on directory for docker-root and one for the containers, they may well be on the same disk, but not on a mergerfs

    OK, so if my DATA disk is on one physical drive there is no problem?


    No ZFS or RAID, is that what you mean with mergerfs?

    • Official Post

    Just installed OMV 6 finaly on a SSD, so now I am going to install it on a thumbdrive because of lack of diskroom in the HP N54 and use the SSD for Docker

    Don't forget to install openmediavault-flashmemory

    • Official Post

    Just one thing to remember: If we talk about setting the correct permissions, you have to set them on the original directory, not the link.

    i.e. the directory in /srv/dev-disk-by-..../....

    This is correct.. for some reason the permissions on the links always show "all" despite not really being that way.

  • Unfortunately the issue has resurfaced. The output of docker inspect portainer shows for log path and mounts the disk label whereas all were changed to uuid, with the /srv/by-label directories deleted:

    Code
            "LogPath": "/srv/dev-disk-by-label-Chimp/AppData2/Docker/containers/75ba                                                                                        5e06fcd2ba6cdf2e02e4c9bdb72afd577dfdada7a97266ff8faab5b893e7/75ba5e06fcd2ba6cdf2                                                                                        e02e4c9bdb72afd577dfdada7a97266ff8faab5b893e7-json.log",
    
          "Mounts": [
                {
                    "Type": "volume",
                    "Name": "portainer_data",
                    "Source": "/srv/dev-disk-by-label-Chimp/AppData2/Docker/volumes/                                                                                        portainer_data/_data",

    My portainer docker-compose.yml is defintely mapped to by..uuid


    docker volume ls is showing 2 volumes - is this causing the issue?

  • give me


    cat /etc/docker/daemon.json

    docker info

    docker ps -a


    Your docker root has not been moved properly to the /srv/dev-disk-by-... directory.

    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.

  • Here you go. It all looks good except for portainer which keeps referencing back to the bylabel ID but none exists anymore.


  • I do not understand what I see. This is a portainer installation created 2 month ago and stopped 7 days ago, but the image tag has been removed in the meantime. it does not have a name or did you cut off the name of the container in the last line at the right?


    Code
    75ba5e06fcd2   a1c22f3d250f                       "/portainer"             2 months ago   Exited (128) 7 days ago   0.0.0.0:8000->8000/tcp, :::8000->8000/tcp, 9443/tcp, 0.0.0.0:9200->9000/tcp, :::9200->9000/tcp  

    I do not see a running portainer container.




    How are you starting your portainer container?


    give me docker image ls 

    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.

  • I do not understand what I see. This is a portainer installation created 2 month ago and stopped 7 days ago, but the image tag has been removed in the meantime. it does not have a name or did you cut off the name of the container in the last line at the right?

    I can't explain why the dates are like they are but the 7 days ago is the new portainer from the outset of this thread. There is nothing cutoff from what I can see. The containers themselves are also working fine, just not portainer.

    How are you starting your portainer container?

    I can't at the moment.


    Code
    root@OMV:~# docker image ls
    REPOSITORY                         TAG       IMAGE ID       CREATED        SIZE
    lscr.io/linuxserver/syncthing      latest    3e86dd0e8a0b   8 days ago     49MB
    plexinc/pms-docker                 latest    50eaaf5e3424   8 days ago     631MB
    lscr.io/linuxserver/resilio-sync   latest    f2c2f16c41dd   2 weeks ago    211MB
    uroni/urbackup-server              latest    ba6cf74a3d2a   2 weeks ago    177MB
    dlandon/logitechmediaserver        latest    53a4242e55d1   5 weeks ago    1.38GB
    portainer/portainer-ce             latest    0df02179156a   2 months ago   273MB

    I feel this portainer image from 2 months ago is not correct, as I created a portainer image last week per post #2.

Participate now!

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