zoneminder/utils/docker
Isaac Connor 0880412e7f Merge branch 'master' into feature-h264-videostorage 2017-02-21 16:04:27 -05:00
..
README.md Update README.md 2016-08-15 04:39:04 -07:00
apache-vhost Fixed broken cgi-bin path 2017-01-14 16:35:46 -08:00
phpdate.ini Update timezone to GMT, reduce SHM requirement to 512M 2016-02-05 14:08:43 +01:00
setup.sh Dockerfile to build feature-h264-videostorage 2017-02-12 13:14:48 +02:00
start.sh Disable SSH 2017-02-14 10:52:00 +01:00

README.md

Overview

Docker allows you to quickly spin up application containers, which are similar to very lightweight virtual machines. The ZoneMinder Dockerfile will start an Ubuntu 12.04 container with MySql, Apache, and PHP properly configured, and will then compile and install ZoneMinder.

It will also start an SSH server that you can use to log into the container.

This is still a bit of a work in progress.

How To Use

  1. Install Docker
  2. Build ZoneMinder container sudo docker build -t yourname/zoneminder github.com/ZoneMinder/ZoneMinder
  3. Run it CID=$(sudo docker run -d -p 222:22 -p 8080:80 --name zoneminder yourname/zoneminder)
  4. Use it -- you can now SSH to port 222 on your host as user root with password root. You can also browse to your host on port 8080 to access the zoneminder web interface

Developing With Docker

If you wish to contribute to ZoneMinder, Docker can be helpful. By re-running docker build in your working directory, any code modifications you have made will be pulled into a new container, compiled, and started, all without modifying your base system.

Development is not totally without annoyances, as any change to the project will require a full rebuild of all C++. Docker notices that the directory which has been ADD'ed is now different, and therefore all steps after the ADD command must be recomputed. A fix for this is to update the Dockerfile to move the configure and make commands into start.sh, and then use a volume mount to cache the build directory (I think it's /tmp) on your host filesystem. This would be really useful for a developer, and would remove the annoying build problem, but some of the Docker push/pull benefits would be lost.

Docker containers can be both CPU and memory limited, so this can be a practical method to compile or run multiple development builds of ZoneFinder simultaneously without taxing your host system.

Use Cases

TODO

  • Describe how to connect to monitors by mounting devices
  • Create a 'development' dockerfile to remove the need to rebuild the entire project after each small change