Official Docker images

Support for the docker image maintained by dlandon
Post Reply
jakob.tewes
Posts: 2
Joined: Mon Mar 07, 2022 12:20 pm

Official Docker images

Post by jakob.tewes »

Heyhey ZoneMinder Forum,

coming up with a question concerning the supported docker images.
Even after some reading and testing, I´m having no idea what might me "the official" docker containers for current zoneminder.

I´ve tested so far:
zoneminderhq/zoneminder:latest-ubuntu18.04
dlandon/zoneminder:latest
dlandon/zoneminder.machine.learning:latest

Both tend to be not really up to date and also I´ve seen some info concerning deprecation in the "dlandon/zoneminder*" images

Can someone help me plz? :-)

Regards

Jakob
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Official Docker images

Post by iconnor »

Simple: Official Docker images will come from ZoneMinder. No one else. So there are none.

We are testing https://github.com/zoneminder-container ... inder-base for demo.zoneminder.com. Have played with dlandon's in the past.

There are too many conflicting tastes/ideas about how this should all be done. You are going to have to figure out which ones suits you best.
jakob.tewes
Posts: 2
Joined: Mon Mar 07, 2022 12:20 pm

Re: Official Docker images

Post by jakob.tewes »

Nice! Helps! Going in with the test :-)
jantman
Posts: 14
Joined: Tue May 08, 2018 11:21 am
Location: Atlanta, GA, USA
Contact:

Re: Official Docker images

Post by jantman »

The dlandon images are definitely marked as deprecated.

The "official" images (zoneminderhq/zoneminder) violate almost all of the Docker-published best practices for images, and on top of that only have a "latest" tag so you'll end up getting image updates when you don't want to or even know (another of the Docker best practices for images).

I've been using a very minimally-modified fork of https://hub.docker.com/r/quantumobject/ ... zoneminder for 2 years now, which meets most best practices for Docker images, but unfortunately is still at 1.34.22 and appears abandoned. I guess I'm going to take a crack at updating my fork for the latest 1.36.

For those who don't deal with Docker on a day-to-day basis, the best practices that I refer to come from Docker development best practices and Best practices for writing Dockerfiles, and the important points boil down to:
  • Everything "set up" in the image should be done at build time not run time (i.e. any package installation, file creation, etc. should be in the Dockerfile not the entrypoint). Entrypoints should be optimized for speed, and if you and I run the same image, what's inside it should always be the same.
  • Tags on a docker image should be immutable and thought of like package versions, i.e. running the "zoneminderhq/zoneminder:1.36.19-1" image should always and forever result in the exact same image (like an OS package version). If my computer falls into a pool of lava and all of its backups are eaten by a monster, I should be able to pull and run "zoneminderhq/zoneminder:1.36.19-1" on my new computer and get the same EXACT thing.
  • I know this is essentially impossible for ZM, but the Docker model is built around one process or service per container, without any sort of supervisor/init/process manager in the container.
  • Docker is really a packaging format, much like dpkg or rpm. The fact that the official images offer a choice of CentOS or Ubuntu base images is just creating more work for the maintainers. The base image shouldn't matter to users, and maintainers should pick whatever is easiest or makes most sense for them and what they're packaging.
I can't offer to maintain a Docker image long-term, but I'd certainly be willing to take a crack at making an image for the current ZM version that follows Docker's guidelines and best practices.
Principal Software Engineer - Some Company
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Official Docker images

Post by iconnor »

@jantman: Why don't you work with us, the other devs and you can be the official docker maintainer.
jantman
Posts: 14
Joined: Tue May 08, 2018 11:21 am
Location: Atlanta, GA, USA
Contact:

Re: Official Docker images

Post by jantman »

iconnor wrote: Wed Jun 22, 2022 1:23 am @jantman: Why don't you work with us, the other devs and you can be the official docker maintainer.
Ok, I'd certainly be open to that. Let me start by trying to get a working image for the latest release that follows as many of the best practices as possible, and then I'll share a link to the repo and see if we can get a discussion going about it. It'll probably take me a week or two, as I've got a really busy week coming up.
Principal Software Engineer - Some Company
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Official Docker images

Post by iconnor »

Please also checkout https://github.com/zoneminder-containers

The author doesn't use them himself, but is active in our slack channel. They are currently powering https://demo.zoneminder.com
good4y0u
Posts: 3
Joined: Sun Jul 11, 2021 3:28 am

Re: Official Docker images

Post by good4y0u »

Well, a year later I am trying to figure out this same question. I am on quantumobject/docker-zoneminder:latest which doesn't exist anymore (its over 2 years old now) (See https://wiki.zoneminder.com/Docker )

What is the latest docker image I should be using so I can update from v1.34.23 to the latest release of v1.36.33
moorsey
Posts: 53
Joined: Sun Jan 03, 2010 8:56 am

Re: Official Docker images

Post by moorsey »

I think the auto building ones iconner posted above are your best bet - https://github.com/zoneminder-container ... inder-base
jantman
Posts: 14
Joined: Tue May 08, 2018 11:21 am
Location: Atlanta, GA, USA
Contact:

Re: Official Docker images

Post by jantman »

Unfortunately I never did anything with this (or at least haven't yet). I'm only using ZM for personal stuff at home, and building a new Docker image so I could upgrade a system that's perfectly functional... rapidly fell down my priority list. Add to that the fact that I haven't worked with PHP or Perl in over a decade, so I doubt that properly crafting a Docker image would be a quick thing for me.

I'm currently running off of a fork of quantumobject/docker-zoneminder:1.34.22-1 that adds a few minor features - symlinking zmeventnotification_secrets.ini into the proper location, apache2 mod-headers enabled, and allowing an optional apache zoneminder.conf site config to be mounted in to the container (the latter two so that I can set a Access-Control-Allow-Origin header to embed the streams).

I've been running off of that version for about 3 years now, and I guess I'm just going to stick with it until either something better (but repeatable) comes around or I finally have need to upgrade.

I'd be happy to help someone work on a proper, Docker-best-practices image... but I really can't commit to providing long-term maintenance or support of anything.
Principal Software Engineer - Some Company
darmach
Posts: 21
Joined: Thu Aug 13, 2015 8:26 am

Re: Official Docker images

Post by darmach »

@jantman I think there are more users in that boat - the host I am running for such "home infra" works basicall as a docker hypervisor, and I'd love to throw in a zoneminder container to that bunch.

I remember how happy I was (tinkering with zoneminder for quite a few years) about 2 years ago when I found that there are docker images - no longer a manual tinkering, installing on components on baremetal directly! Now I wanted to get back to it, and finally finish my monitoring... and it seem these images are no longer maintaned...
Magic919
Posts: 1381
Joined: Wed Sep 18, 2013 6:56 am

Re: Official Docker images

Post by Magic919 »

Just use the one mentioned above.
-
jantman
Posts: 14
Joined: Tue May 08, 2018 11:21 am
Location: Atlanta, GA, USA
Contact:

Re: Official Docker images

Post by jantman »

I was almost hesitant to mention this here, but I have a new ZM 1.36.33 Docker image that I'm using at home. I've only had it up and running for 4 days but it seems to be stable. It's based on the official Debian Bookworm (12.2) Docker image and just installs ZM from the Debian repo, mostly following the process described in the docs and wiki. I also have ZMES installed in it along with the hook scripts, but if you want ML it's expected that you'll use MLAPI (I now have an image for that as well, in addition to a Prometheus exporter for ZM and an image that ships ZM's logs from the MySQL DB to a Loki instance).

There are a few non-standard things in the container, so be aware of that... zoneminder is at the web root (/) instead of the common /zm prefix, Apache server status is exposed to any client, and I've also made a bunch of fixes to ZMES' zm_detect.py and some fixes to the hook scripts for running ZM with auth disabled. In short, this is an image intended for a Docker environment where you're handling auth with a reverse proxy or something.

I'm only mentioning this here because it's essentially provided as-is with little to no support; I'll review PRs and merge them if they seem straightforward and like something I'll use myself, but unfortunately I have neither the time nor the inclination to provide support for this or take it on as a real "project".
Principal Software Engineer - Some Company
User avatar
iconnor
Posts: 2880
Joined: Fri Oct 29, 2010 1:43 am
Location: Toronto
Contact:

Re: Official Docker images

Post by iconnor »

@jantman link? Sounds interesting and of course, we would love to get your fixes for zm_detect.py merged.
jantman
Posts: 14
Joined: Tue May 08, 2018 11:21 am
Location: Atlanta, GA, USA
Contact:

Re: Official Docker images

Post by jantman »

iconnor wrote: Thu Jan 04, 2024 3:20 pm @jantman link? Sounds interesting and of course, we would love to get your fixes for zm_detect.py merged.
The docker image is here: https://github.com/jantman/docker-zoneminder and also on Docker Hub with the same slug. I'd really planned on doing an almost-complete rewrite of zm_detect.py to be more "Pythonic", but I sort of decided that if it was working that was good enough. I'd be happy to open a PR with the zm_detect changes if there's interest in getting them merged.

The other related projects that I mentioned are https://github.com/jantman/zoneminder-loki https://github.com/jantman/zoneminder-p ... s-exporter and https://github.com/jantman/docker-zm-mlapi respectively (note the mlapi container only supports CPU right now, I haven't attempted to tackle GPU in Docker yet).
Principal Software Engineer - Some Company
Post Reply