Page 1 of 1
Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 8:26
by BPMb
Hi there!
I've been running Domoticz in Docker using the Linuxserver Docker image but it doesn't give me the latest version so I decided to make my own.
In the image, I clone the domoticz git and build it, which is succesful, but when I start the image and login I still get the message saying that a later version is available. It says version 11995 is available.
I thought I'd be getting the latest version automatically when building from source?
This is the part in my dockerfile where I clone the repo and build it:
Code: Select all
cd /opt && \
git clone --depth 1 https://github.com/domoticz/domoticz.git domoticz && \
cd domoticz && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-Wno-dev -Wno-deprecated && \
make && \
rm -rf /opt/domoticz/.git* && \
Does anyone know why this happens? Do I really need to update domoticz after installing from source?
Thanks!
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 9:25
by kiddigital
When you build from source, the new Domoticz executable is build in the ‘bin’ subdirectory. Make sure that version gets started (and not the one that remains in the domoticz root directory = old version)
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 9:30
by BPMb
Thanks for you reply!
My entrypoint is indeed a script that calls /opt/domoticz/domoticz. I had a look and although a bin subdirectory exists (i.e. /opt/domoticz/bin), there are no files in there..
I did a quick search on the system and can't find any other domoticz binary to launch either..
Any suggestions?
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 9:34
by kiddigital
BPMb wrote:Thanks for you reply!
My entrypoint is indeed a script that calls /opt/domoticz/domoticz. I had a look and although a bin subdirectory exists (i.e. /opt/domoticz/bin), there are no files in there..
I did a quick search on the system and can't find any other domoticz binary to launch either..
Any suggestions?
Are you sure the build process run successfully? Delete the one domoticz binary and see if a new one gets build.
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 10:03
by BPMb
I do see some errors in the build process:
Code: Select all
CMake Warning:
No source or binary directory provided. Both will be assumed to be the
same as the current working directory, but note that this warning will
become a fatal error in future CMake releases.
and a little later:
Code: Select all
[ 15%] Building C object extern/minizip/CMakeFiles/minizip.dir/zip.c.o
/opt/domoticz/extern/minizip/zip.c: In function 'zipOpenNewFileInZip4_64':
/opt/domoticz/extern/minizip/zip.c:1248:28: warning: assignment to 'const long unsigned int *' from incompatible pointer type 'const z_crc_t *' {aka 'const uns
igned int *'} [-Wincompatible-pointer-types]
zi->ci.pcrc_32_tab = get_crc_table();
^
[ 17%] Linking C static library ../../lib/libminizip.a
[ 17%] Built target minizip
Seeing as I build this in a docker image there's no binary to be removed before the build process. Or do you mean build it, remove the /opt/domoticz/domoticz binary and build again?
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 10:16
by kiddigital
Make sure your git clone checks out the beta branch otherwise you build the stable.
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 10:21
by BPMb
I thought I would want the stable, the message about the update should also be about the stable release (that's all that's configured in the update check inside Domoticz in any case).
Do I need the beta branch in order to get the latest stable release? Or do you think the version it suggests I update to (11995) is a beta version?
Re: Building domoticz from source gets me previous version
Posted: Saturday 31 October 2020 11:36
by kiddigital
Check the site and wiki for the exact build numbers of the latest stable and beta.
Re: Building domoticz from source gets me previous version
Posted: Sunday 01 November 2020 15:30
by BPMb
Thanks for all the suggestions @kiddigital. I've solved it like this:
At the top of the dockerfile:
And then later:
Code: Select all
# Domoticz
cd /opt && \
git clone -b "${DOMOTICZ_VERSION}" --depth 2 https://github.com/domoticz/domoticz.git domoticz && \
cd domoticz && \
git fetch --unshallow && \
cmake \
-DCMAKE_BUILD_TYPE=Release \
-Wno-dev -Wno-deprecated && \
make && \
rm -rf /opt/domoticz/.git* && \
Building domoticz from source gets me previous version
Posted: Sunday 01 November 2020 16:17
by kiddigital
Great that is has been solved
Maybe you can publish your Dockerfile(s) and readme.md on Github or Domoticz Wiki (or refer from one to other) so others can build certain version of Domoticz themselves as well.
And explain how to switch between version, etc.
How the port forwarding works, etc...
Btw, where do you keep the domoticz.db? In the container or external on a mount somewhere?
Re: Building domoticz from source gets me previous version
Posted: Sunday 01 November 2020 18:23
by BPMb
I will once I'm done, next problem is to get the toonapilib4domoticz plugin preinstalled in the image. It's there but I get an error when it tries to load so needs some more work I'm afraid!
edit: I keep the db on my ZFS mount and simply mount that into the container