How to add a volume to an existing docker container?

  • I have the zoneminder docker image running under OMV5 just fine with 3 cameras. Except that the default storage mount is the same as OMV, which is not a very large drive. I have a drive to dedicate to ZM installed and set up on OMV and am able to access it both with NFS and SMB. I added it in the 'volumes' section of Portainer. But how the heck do I add it to the ZM container??

  • Don't add it to the Volumes section of Portainer. Add it to the ZM container by editing the container and deploying the container after editing.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Don't add it to the Volumes section of Portainer. Add it to the ZM container by editing the container and deploying the container after editing.

    Thanks for replying. Under containers > zoneminder, I found the section for 'Volumes' which has 'zoneminder/data' and 'zoneminder' but there is no edit or add that I can find.

  • Click on the container name. Then click on the Duplicate / Edit button.

    Thanks! I found all that and 'zonemindernas' appears to be added OK. I selected it from the menu of local volumes and after saving the volume details appear correct. Zoneminder in the revised container starts up, but then the ZM 'storage' option refuses to accept it. I put the path as copied from what Portainer says is "path in container' but upon saving ZM lists it as the original default location! It even renames it to 'Default'. I tried several times and now have 7 identical 'Default' storage locations, all identical. :/ Kinda weird! Adding it to the Volumes section will do all the necessary mounting behind the scenes for the container or is there some additional step for that I missed?

  • You might be better off using Bind mounts. Also it is difficult to help when you haven't provided any information about how you configured the container, not even the image name and where you got it.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • You might be better off using Bind mounts. Also it is difficult to help when you haven't provided any information about how you configured the container, not even the image name and where you got it.


    Oh, sorry, it's the one linked from Zoneminder's site as the somewhat official version. It is called dlandon/zoneminder.master:latest

    As for how I configured it, I just started it up as is. This is the first time I tried Docker so all I'm still fumbling about.


    Can you give me some direction for how to set up the bind type mount? I ssh'd to my OMV and poked around the filesystem but I can't figure out where it was put.

  • docker exec -i <container_name> sh -c printenv

    Code
    ZM_DIR_EVENTS=/full/path/to/the/events/folder

    https://zoneminder.readthedocs…guide/dedicateddrive.html


    In my understanding and unless it's a real bug, if that variable is set to your path with permissions, it should work.

    I don't think I can do that without first setting up the docker image to know about the mount, which is what I'm having trouble doing.

  • Oh, sorry, it's the one linked from Zoneminder's site as the somewhat official version. It is called dlandon/zoneminder.master:latest

    As for how I configured it, I just started it up as is. This is the first time I tried Docker so all I'm still fumbling about.


    Can you give me some direction for how to set up the bind type mount? I ssh'd to my OMV and poked around the filesystem but I can't figure out where it was put.

    Started it up as is doesn't say anything.


    The docker run command provided in the image documentation provides what you need to configure the container. You do need to select proper values for the various variables to fit your use case.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • Started it up as is doesn't say anything.


    The docker run command provided in the image documentation provides what you need to configure the container. You do need to select proper values for the various variables to fit your use case.

    Sorry, Zoneminder's website seems to be having issues and I can't get at those details. I just pasted in what they had as a default.

  • The docker run, docker compose, and docker create commands that you will see in the documentation pages of images are in almost every case examples, not working configurations that anyone and everyone can just run as is. You need to examine every line in such examples and decide for yourself if it can be used as is or must be modified to match your specific use case. To do this you need to have at least a basic understanding of docker and Linux principles. This knowledge is assumed, and this assumption is not mentioned anywhere.

    --
    Google is your friend and Bob's your uncle!


    OMV AMD64 5.x on ASRock Rack C2550D4I C0 Stepping - 16GB ECC - Silverstone DS380 + Silverstone DS380 DAS Box.

  • The docker run, docker compose, and docker create commands that you will see in the documentation pages of images are in almost every case examples, not working configurations that anyone and everyone can just run as is. You need to examine every line in such examples and decide for yourself if it can be used as is or must be modified to match your specific use case. To do this you need to have at least a basic understanding of docker and Linux principles. This knowledge is assumed, and this assumption is not mentioned anywhere.

    OK, I've gone over the example settings again and I think I see where to put the path. However, where has OMV 5 put it? So, using the OMV management page I've created a volume called 'zonemindernas' on a dedicated disk. However, it is not neatly under /mnt/ on the filesystem and the management page gives no hints as to where it might really be. "find zonemindernas -type d" did not locate it. I assume these are aliased somehow?

    thanks for the help and patience so far.

Participate now!

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