Trying to setup a docker test env.

Current Development version likely to have breaking changes
Post Reply
GadgetChris
Posts: 11
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Trying to setup a docker test env.

Post by GadgetChris »

At https://github.com/ZoneMinder/zoneminder/wiki/Docker it describes the setup of a dev environment in docker.
I'm trying to follow it, and it's complaining about :

Code: Select all

chris@aurora:~/dev/zm-docker$ docker buildx build -t='linuxlover9/release-1.36.33' github.com/ZoneMinder/zoneminder
[+] Building 8.6s (1/1) FINISHED                                                                         docker:default
 => [internal] load git source github.com/ZoneMinder/zoneminder                                                    8.4s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3288439779/Dockerfile: no such file or directory 
The same happens when trying to use my own branch.

Code: Select all

chris@aurora:~/dev/zoneminder$ docker build -t='linuxlover9/release-1.36.33' .
[+] Building 0.2s (2/2) FINISHED                                                                         docker:default
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 2B                                                                                 0.0s
 => [internal] load .dockerignore                                                                                  0.1s
 => => transferring context: 45B                                                                                   0.0s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1151009449/Dockerfile: no such file or directory
Clearly this is my first attempt setting up a dev env for ZM.
:wink:

I see there is a separate project https://github.com/ZoneMinder/zmdockerf ... Dockerfile
I'm not sure how to marry the two together to be able to run my code :?:
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
GadgetChris
Posts: 11
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Re: Trying to setup a docker test env.

Post by GadgetChris »

OK, I have test docker running from source zoneminderhq/zoneminder:latest-ubuntu18.04.
How can I run my local code?
Do I have to do a cmake? what are the options?
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
GadgetChris
Posts: 11
Joined: Wed Mar 13, 2024 3:31 am
Location: GTA, ON, Canada

Re: Trying to setup a docker test env.

Post by GadgetChris »

Seems the Dockerfile is missing.
Found zmdockerfiles https://github.com/ZoneMinder/zmdockerf ... Dockerfile
With the following result:

Code: Select all

~/dev/zoneminder$ docker build -t linuxlover9/zm-1.36.33-chk .
[+] Building 4.1s (7/10)                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 4.88kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 45B                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:impish                                                   0.7s
 => [1/7] FROM docker.io/library/ubuntu:impish@sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9  1.5s
 => => resolve docker.io/library/ubuntu:impish@sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9  0.0s
 => => sha256:240a11a56faca317f3355b143b5cc2791ba60ad0edd393b3ae3c85c29cad1a6c 529B / 529B                         0.0s
 => => sha256:50398b9058c55fa969c8ab5db6a11ff52686a9b6738884a9113d164dc567dfac 1.46kB / 1.46kB                     0.0s
 => => sha256:54b8fda3c9de3a40f0891ce200de55fc92e825315021192957f1bfe3fc807d7d 30.38MB / 30.38MB                   0.6s
 => => sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9c8154 1.42kB / 1.42kB                     0.0s
 => => extracting sha256:54b8fda3c9de3a40f0891ce200de55fc92e825315021192957f1bfe3fc807d7d                          0.6s
 => [2/7] RUN echo 'apt::install-recommends "false";' > /etc/apt/apt.conf.d/00recommends                           0.6s
 => [3/7] RUN apt-get install --reinstall -y gpgv                                                                  0.4s
 => ERROR [4/7] RUN apt-get update                                                                                 0.7s
------                                                                                                                  
 > [4/7] RUN apt-get update:                                                                                            
0.507 Ign:1 http://security.ubuntu.com/ubuntu impish-security InRelease                                                 
0.525 Ign:2 http://archive.ubuntu.com/ubuntu impish InRelease                                                           
0.527 Err:3 http://security.ubuntu.com/ubuntu impish-security Release                                                   
0.527   404  Not Found [IP: 91.189.91.81 80]                                                                            
0.553 Ign:4 http://archive.ubuntu.com/ubuntu impish-updates InRelease
0.579 Ign:5 http://archive.ubuntu.com/ubuntu impish-backports InRelease
0.604 Err:6 http://archive.ubuntu.com/ubuntu impish Release
0.604   404  Not Found [IP: 91.189.91.81 80]
0.629 Err:7 http://archive.ubuntu.com/ubuntu impish-updates Release
0.629   404  Not Found [IP: 91.189.91.81 80]
0.655 Err:8 http://archive.ubuntu.com/ubuntu impish-backports Release
0.655   404  Not Found [IP: 91.189.91.81 80]
0.659 Reading package lists...
0.669 E: The repository 'http://security.ubuntu.com/ubuntu impish-security Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish-updates Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish-backports Release' does not have a Release file.
------
Dockerfile:15
--------------------
  13 |     RUN apt-get install --reinstall -y gpgv
  14 |     
  15 | >>> RUN apt-get update 
  16 |     
  17 |     RUN apt-get install -y \
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update" did not complete successfully: exit code: 100

Any hints, to get this noob further on my way, would be appreciated...

Thank you, GadgetChris
zm-v1.36.33 in docker @ Ubuntu 22.04.4.LTS
User avatar
burger
Posts: 442
Joined: Mon May 11, 2020 4:32 pm

Re: Trying to setup a docker test env.

Post by burger »

GadgetChris wrote: Sat Mar 23, 2024 6:53 pm Seems the Dockerfile is missing.
Found zmdockerfiles https://github.com/ZoneMinder/zmdockerf ... Dockerfile
With the following result:

Code: Select all

~/dev/zoneminder$ docker build -t linuxlover9/zm-1.36.33-chk .
[+] Building 4.1s (7/10)                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 4.88kB                                                                             0.0s
 => [internal] load .dockerignore                                                                                  0.0s
 => => transferring context: 45B                                                                                   0.0s
 => [internal] load metadata for docker.io/library/ubuntu:impish                                                   0.7s
 => [1/7] FROM docker.io/library/ubuntu:impish@sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9  1.5s
 => => resolve docker.io/library/ubuntu:impish@sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9  0.0s
 => => sha256:240a11a56faca317f3355b143b5cc2791ba60ad0edd393b3ae3c85c29cad1a6c 529B / 529B                         0.0s
 => => sha256:50398b9058c55fa969c8ab5db6a11ff52686a9b6738884a9113d164dc567dfac 1.46kB / 1.46kB                     0.0s
 => => sha256:54b8fda3c9de3a40f0891ce200de55fc92e825315021192957f1bfe3fc807d7d 30.38MB / 30.38MB                   0.6s
 => => sha256:ff46b78279f207db3b8e57e20dee7cecef3567d09489369d80591f150f9c8154 1.42kB / 1.42kB                     0.0s
 => => extracting sha256:54b8fda3c9de3a40f0891ce200de55fc92e825315021192957f1bfe3fc807d7d                          0.6s
 => [2/7] RUN echo 'apt::install-recommends "false";' > /etc/apt/apt.conf.d/00recommends                           0.6s
 => [3/7] RUN apt-get install --reinstall -y gpgv                                                                  0.4s
 => ERROR [4/7] RUN apt-get update                                                                                 0.7s
------                                                                                                                  
 > [4/7] RUN apt-get update:                                                                                            
0.507 Ign:1 http://security.ubuntu.com/ubuntu impish-security InRelease                                                 
0.525 Ign:2 http://archive.ubuntu.com/ubuntu impish InRelease                                                           
0.527 Err:3 http://security.ubuntu.com/ubuntu impish-security Release                                                   
0.527   404  Not Found [IP: 91.189.91.81 80]                                                                            
0.553 Ign:4 http://archive.ubuntu.com/ubuntu impish-updates InRelease
0.579 Ign:5 http://archive.ubuntu.com/ubuntu impish-backports InRelease
0.604 Err:6 http://archive.ubuntu.com/ubuntu impish Release
0.604   404  Not Found [IP: 91.189.91.81 80]
0.629 Err:7 http://archive.ubuntu.com/ubuntu impish-updates Release
0.629   404  Not Found [IP: 91.189.91.81 80]
0.655 Err:8 http://archive.ubuntu.com/ubuntu impish-backports Release
0.655   404  Not Found [IP: 91.189.91.81 80]
0.659 Reading package lists...
0.669 E: The repository 'http://security.ubuntu.com/ubuntu impish-security Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish-updates Release' does not have a Release file.
0.669 E: The repository 'http://archive.ubuntu.com/ubuntu impish-backports Release' does not have a Release file.
------
Dockerfile:15
--------------------
  13 |     RUN apt-get install --reinstall -y gpgv
  14 |     
  15 | >>> RUN apt-get update 
  16 |     
  17 |     RUN apt-get install -y \
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update" did not complete successfully: exit code: 100

Any hints, to get this noob further on my way, would be appreciated...

Thank you, GadgetChris
It's unable to connect to the ubuntu repos. In my experience, this is usually a DNS issue, but it seems to have the IP address so maybe it's just a routing issue. If you run the container and have it idle at the end, can you login to the container and manually connect to the repos with wget or ping? Maybe the repo URL has changed. Maybe it's a firewall issue between docker and your computer.

The situation with Docker and ZM, is the following:
1) the devs aren't really working on it, it's only been from volunteers who have made some images. So you are mostly on your own
2) this should be posted in the docker forum
3) this looks like a fundamental docker troubleshooting issue that is not related to ZM. You might want to familiarize yourself with Docker a bit more. I've recommended the book by Adrian Mouat a couple times (although it's older, but probably still relevant).

I doubt anything with ZM and docker is difficult, but it's a timesink and so far people just haven't had the bandwidth to work on it. Finally, you should look through the docker forum to see what else is available. From my memory you should be able to find a working ZM configuration, but might have trouble finding one with ZMES and MLAPI.
fastest way to test streams:
ffmpeg -i rtsp://<user>:<pass>@<ipaddress>:554/path ./output.mp4 (if terminal only)
ffplay rtsp://<user>:<pass>@<ipaddress>:554/path (gui)
find paths on ispydb or in zm hcl

If you are new to security software, read:
https://wiki.zoneminder.com/Dummies_Guide
kennaanna
Posts: 1
Joined: Mon Oct 23, 2023 4:26 am

Re: Trying to setup a docker test env.

Post by kennaanna »

GadgetChris wrote: Mon Mar 18, 2024 1:17 am At https://github.com/ZoneMinder/zoneminder/wiki/Docker the innocence test it describes the setup of a dev environment in docker.
I'm trying to follow it, and it's complaining about :

Code: Select all

chris@aurora:~/dev/zm-docker$ docker buildx build -t='linuxlover9/release-1.36.33' github.com/ZoneMinder/zoneminder
[+] Building 8.6s (1/1) FINISHED                                                                         docker:default
 => [internal] load git source github.com/ZoneMinder/zoneminder                                                    8.4s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount3288439779/Dockerfile: no such file or directory 
The same happens when trying to use my own branch.

Code: Select all

chris@aurora:~/dev/zoneminder$ docker build -t='linuxlover9/release-1.36.33' .
[+] Building 0.2s (2/2) FINISHED                                                                         docker:default
 => [internal] load build definition from Dockerfile                                                               0.1s
 => => transferring dockerfile: 2B                                                                                 0.0s
 => [internal] load .dockerignore                                                                                  0.1s
 => => transferring context: 45B                                                                                   0.0s
ERROR: failed to solve: failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount1151009449/Dockerfile: no such file or directory
Clearly this is my first attempt setting up a dev env for ZM.
:wink:

I see there is a separate project https://github.com/ZoneMinder/zmdockerf ... Dockerfile
I'm not sure how to marry the two together to be able to run my code :?:
It seems like the Dockerfile is missing. Make sure it's in the root of your project directory. If you cloned the repo, double-check its location. You can also try adjusting your build command to specify the correct path. Good luck!
Post Reply