ZoneMinder on Docker doesn't save Monitors between reboots

Forum for questions and support relating to the 1.28.x releases only.
Locked
Simpler
Posts: 76
Joined: Mon Nov 02, 2015 12:40 am

ZoneMinder on Docker doesn't save Monitors between reboots

Post by Simpler »

I used the instructions at the following location to run ZoneMinder 1.28.x using docker:
http://www.zoneminder.com/wiki/index.ph ... ommands%29

I ran these on a VM of Linux Mint 17.2.

Zoneminder started up with no problem (which was incredible that this works with only two steps).
The problem is that as soon as I add my Monitor in ZoneMinder and restart the VM, ZoneMinder starts up automatically, but my Monitor is gone.

I tried both sets of docker commands on this site and neither would save my Monitor between VM reboots.

How can I get ZoneMinder to save my Monitor between sessions when using docker?
Simpler
Posts: 76
Joined: Mon Nov 02, 2015 12:40 am

Re: ZoneMinder on Docker doesn't save Monitors between reboots

Post by Simpler »

From what I can tell (and the little that I've read about using Docker), it looks like Docker is great for a quick test environment, but not for production.

If it were used as a production environment, you would have to do a "docker commit" every time before you reboot which is not practical if your system goes down for some unknown reason (e.g. power outage). In this case you would lose all of your data.

If I'm correct in the above statements, then we should add some text to the Docker install page for ZoneMinder to warn users that it only for testing.
If I'm not correct, please let me know how docker can be run and maintain the settings and data between reboots.
SteveGilvarry
Posts: 494
Joined: Sun Jun 29, 2014 1:12 pm
Location: Melbourne, AU

Re: ZoneMinder on Docker doesn't save Monitors between reboots

Post by SteveGilvarry »

Check out Docker data persistence, mysql would normally be attached to a persistent data store. I have not done it but read about it a few months back before moving on to other things. There is another repo on github that claims to be fully persistent without requiring separate data containers.
Production Zoneminder 1.37.x (Living dangerously)
Random Selection of Cameras (Dahua and Hikvision)
patpend
Posts: 43
Joined: Thu Mar 13, 2014 12:23 pm

Re: ZoneMinder on Docker doesn't save Monitors between reboots

Post by patpend »

In theory starting your container using -v option to map each of the mysql, image, and events dirs to a dir on the host filesystem (outside the container) should persist all of Zoneminder's operational data between reboots.

Code: Select all

...-v /var/local/mysql:/var/lib/mysql -v /var/local/zm/images:/usr/share/zoneminder/images -v /var/local/zm/events:/usr/share/zoneminder/events...
Just thinking out loud here but if this is not happening then it could be that one or more additional dirs or files (/etc/zm comes to mind) need to be mapped out of the container. It could also be that re-starting the container is causing one or more configuration databases to get reinitialized.
Locked