joshuacox / mkdomoticz

Make a persistent domoticz container PDQ
GNU General Public License v3.0
16 stars 28 forks source link

Possible improvements #1

Closed dzonekl closed 7 years ago

dzonekl commented 7 years ago

Hi,

Well first thanks for this project, it worked for me on an RPI. I wonder, there is few domoticz/docker projects. Is this the official one?

Some observations.

I might have a go with a PR for these issues.

rtenklooster commented 7 years ago

Update isn't working here as well. It says it's not able to download the file. Tried several network configurations but it's not able to download the update for some reason.

dzonekl commented 7 years ago

Hi rtenklooster, the reason I think is that domoticz misses the undelying tools (wget etc..) needed to update. On the cmd line it's a bash script. I have further looked into the issue, and I think when building the docker image locally, one would checkout the latest code.

So there are two possible solutions:

I think, I am going to fork this project and try a couple of things, as the author is not responding here.

Cheers Christophe

joshuacox commented 7 years ago

I am here, sorry about the non-responsiveness, if you fix it, please give me pull request. I will look into this as well right now

joshuacox commented 7 years ago

make build should update everything now, notice I'm using the local-stretch branch for RPI

dzonekl commented 7 years ago

Hi Joshua, cool! will give it spin. So do I need to checkout the local-strech and have a Jessy image, or will this work without the other repo?

joshuacox commented 7 years ago

ya on my RPi I checkout the 'local-stretch' branch and build from there. Of note, local-stretch must be built:

make stretch inside a clone of this: https://github.com/joshuacox/local-debian

which is a method of using debootstrap to build a debian machine from scratch in a chroot and then tarring the whole thing up to make a docker image, I should make another branch that uses a well known raspberryPi debian image from docker hub. But building images from scratch locally is a 'best practice' and certainly is the priority. Let me know if I can explain everything further, and I'll gladly consider pull requests of any sort, even just documentation.

Looking back at your original post, I'm guessing the time issue is perhaps related to this comment

joshuacox commented 7 years ago

I just realized you guys might be coming from hub.docker.com and not using the git repo at all, in which case the 'arm' branch at docker hub has been updated:

https://hub.docker.com/r/joshuacox/mkdomoticz/tags/

Let me know if you guys have any trouble

dzonekl commented 7 years ago

Hi Joshua, I am struggling with the whole thing. I am afraid of loosing my DB. When I look at the MakeFile, the command run, als calls config, which restores the default .db in this repo.

run: PORT config pull rundocker

The config command restores the default .db file (from June) , in /datadir basically overwritting the current db. I am not very familiar with Makefile, so perhaps it's not as a I describe, can you please explain?

Also the Make grab, seems to get a file from the container /confug, streamed as tar and restoring in the shared volume /datadir/config, basically overwritting itself! What's the point? or is this a misinterpretation as well?

I have now made a backup form the shared volume, so I can play around, and will report back here later.

Edit: I noticed new commits on 'master' not the 'arm' branch. So will 'make build' also work on the 'arm' branch?

joshuacox commented 7 years ago

sorry again, for the lag in response, I am getting rid of some cruft in my github watches (way too noisy at the moment)

make build was never really meant to work in the arm branch it was always meant to pull from docker hub.

make grab <-- is a utility that need only be ran once, I'm not even certain it is necessary anymore. Essentially you would run make init, let it settle, then run make grab, this 'grabs' the directory structure of our data directory from a running domoticz, then you would make clean to shut it all down, and then start it all back up using make run, of late I've renamed these actions init-> temp and run->prod which hopefully makes them more self explanatory.

The only difference between init/temp and run/prod is that the $(DATADIR)/config directory is mounted in as /config in the run/prod version, and I believe that domoticz will fill that directory even if you were to mount an empty one in using make run without ever having ran the init and grab sequence. So it all may be unnecessary.

Sorry that arm branch was a little stale, I merged master into it, but you are maybe best off with the 'local-stretch' branch now as make build should work anywhere so long as you have built a local-stretch using my local-debian script, and are using the local-stretch branch

I'll update the readme and point out that master is really only for x86_64 (and people who are comfortable pulling images from hub.docker), everyone else should be using local-stretch I think at this point, I think the arm branch should be equivalent to using the master branch without any local builds (you pull from joshuacox/mkdomoticz:arm instead of building anything locally)

joshuacox commented 7 years ago

I have attempted to better explain this all in the readme, I welcome pull requests, especially on documentation. But just adding aliases like I did for temp and prod

prod: run
temp: init

just to give something a freindlier or more self explanatory label is helpful

joshuacox commented 7 years ago

and you were absolutely correct in the 'config' step blowing away databases, thanks for catching that bug I think I have eliminated that from all the branches

joshuacox commented 7 years ago

I recently upgrade this to ask you for timezone (TZ) during the build process. I'm going to close this issue for now. @dzonekl please feel free to reopen (or make new issues) if something else can be done.