Page 4 of 11

Re: Oficial Docker Container

Posted: Friday 07 May 2021 10:56
by knireis
Chris12 wrote: Friday 07 May 2021 10:44 Some questions about the domoticz docker:

How can I create my own docker after installing some extra packages like:
- apt update
- apt install curl
- apt install python
- apt install python-requests
- apt-get install sudo
- apt-get install openssh-server
All needed for getting my scripts working.

How can I check for updates of domoticz?
I now run version 2021.1 (build 13243), will there be a pop-up notifiying me when a new version is available? Or is that a complete new docker image?
You mean you want to install those packages in the docker container? I did it with a switch in domoticz which is toggled automatically (with a dzvents script) after domoticz startsup. Then the switch triggers another script which installs the necessary packages.

Re: Oficial Docker Container

Posted: Friday 07 May 2021 12:10
by Chris12
Yes, I installed those packages in the docker container. and I'm looking for an easy way to do these steps whenever a new domoticz docker is available.
Can you share both scripts?

Re: Oficial Docker Container

Posted: Friday 07 May 2021 12:19
by knireis

Code: Select all

return
{
    on =
    {
        system =
        {
            'start',
        },
    },
    logging =
    {   
        level = domoticz.LOG_DEBUG,
        marker = 'start',
    },
    execute = function(dz)
        dz.devices('Linphone-S').switchOn().afterSec(20)
    end
}

Code: Select all

#!/bin/bash

apt update && apt -y dist-upgrade

apt install -y <here your packages> 

exit

Re: Oficial Docker Container

Posted: Friday 07 May 2021 12:47
by Gravityz
i think you can do it 2 ways

docker ps -a
docker commit [CONTAINER_ID] [new_image_name]

eg
docker commit a94eb9694608 domoticzname:13188

this will give you the new image name with all the apt-get changes you made

you can also save the current image to an external directory
eg
• docker save domoticz/domoticz:latest | gzip >/volume1/docker/images/domoticz13149-curl-nmap.tar.gz


i would never ever run an update from within the container
if the update fails or screws up things you do not have a working container anymore

always create a new version of the container by copying the settings and use the new image
this way you have a new container with a new version but still have the old container with the old version

Re: Oficial Docker Container

Posted: Sunday 09 May 2021 12:41
by parkerc
Hi

Quick question ; how do you do a restart Domoticz when you’re running it via Docker.?

I can get to the command line via the following ..

Code: Select all

 docker exec -it domoticz-bridge /bin/bash
But the standard approach below does not work, as sudo is not found ..

Code: Select all

 sudo systemctl restart domoticz.service

Re: Oficial Docker Container

Posted: Thursday 13 May 2021 15:43
by pvklink
which image/docker did you use...

Re: Oficial Docker Container

Posted: Thursday 13 May 2021 15:52
by knireis
parkerc wrote: Sunday 09 May 2021 12:41 Hi

Quick question ; how do you do a restart Domoticz when you’re running it via Docker.?

maybe not a direct answer to your question, but why not restart the docker? does not take that much time

Re: Oficial Docker Container

Posted: Tuesday 25 May 2021 12:32
by rezzalex
Hello everyone,
sorry if the question has already been raised previously.

Would that be possible to keep the "old" Build of DZ Beta to be able to roll back to a previous docker beta version in case of bugs?
I know I can keep my own dz docker image... but I would feel safer if I can retreive any version.

Re: Oficial Docker Container

Posted: Tuesday 25 May 2021 13:34
by DAVIZINHO
rezzalex wrote: Tuesday 25 May 2021 12:32 Hello everyone,
sorry if the question has already been raised previously.

Would that be possible to keep the "old" Build of DZ Beta to be able to roll back to a previous docker beta version in case of bugs?
I know I can keep my own dz docker image... but I would feel safer if I can retreive any version.
There is a issue with this suggestion, create more docker images, with stable. and maybe with all the betas or one before the last.
coment in the issue will be interesting

https://github.com/domoticz/domoticz/issues/4810

Re: Oficial Docker Container

Posted: Monday 05 July 2021 8:36
by antonlamers
Hi,
I want to instal a python plugin i have nu userdata directory were must i do it?
As you can see all my data is in another volume this is for resetting the raspberry pi i don't lose the data from the containers

i have this in my yml file:

# Domoticz
domoticz:
container_name: domoticz
image: domoticz/domoticz
ports:
- "8081:8080"
- "6144:6144"
- "1443:1443"
volumes:
- ./volumes/domoticz/data:/config
restart: unless-stopped
environment:
- PUID=1000
- PGID=1000
- TZ= Europe/Amsterdam
devices:
- /dev/ttyAMA0
- /dev/ttyS0
- /dev/ttyACM0
- /dev/ttyACM1
- /dev/ttyUSB0

Re: Oficial Docker Container

Posted: Monday 05 July 2021 9:04
by waltervl
Volumes should be defined as:
volumes:
- <path to domoticz volume>:/opt/domoticz/userdata

eg
- ./volumes/domoticz/data:/opt/domoticz/userdata

Re: Oficial Docker Container

Posted: Monday 05 July 2021 14:12
by antonlamers
Hi,
Thanks, yes i ssee now te plugin directory
can i remove this line?:
- ./volumes/domoticz/data:/config

That line was an example from IOTstack. https://github.com/SensorsIot/IOTstack

Re: Oficial Docker Container

Posted: Monday 05 July 2021 14:35
by antonlamers
another question,
i want to add plugin manager or this 2 plugins: wled and deconz plugin's
how must i do this in the conrtainer?

Re: Oficial Docker Container

Posted: Monday 05 July 2021 15:22
by waltervl
antonlamers wrote: Monday 05 July 2021 14:12 Hi,
Thanks, yes i ssee now te plugin directory
can i remove this line?:
- ./volumes/domoticz/data:/config

That line was an example from IOTstack. https://github.com/SensorsIot/IOTstack
Yes, delete that line as that refers to another (non official) domoticz docker image.

Re: Oficial Docker Container

Posted: Monday 05 July 2021 15:30
by waltervl
I am not sure plugin manager is docker compatible.
You have to enter the docker image and do the installations from the command line within the Domoticz docker installation if extra Python modules are needed. If not you can also install them outside the docker in the <path to domoticz volume>/plugins. After a restart of Domoticz it should see the plugins.

Re: Oficial Docker Container

Posted: Sunday 18 July 2021 17:30
by DAVIZINHO
Hello.
the docker container have this variable: EXRA_CMD_ARG

someone know what is this? what do?

Re: Oficial Docker Container

Posted: Sunday 18 July 2021 18:46
by waltervl
DAVIZINHO wrote: Sunday 18 July 2021 17:30 Hello.
the docker container have this variable: EXRA_CMD_ARG

someone know what is this? what do?
Here you can put extra Domoticz command line arguments https://www.domoticz.com/wiki/Command_line_parameters

Re: Oficial Docker Container

Posted: Sunday 18 July 2021 20:36
by DAVIZINHO
waltervl wrote: Sunday 18 July 2021 18:46
DAVIZINHO wrote: Sunday 18 July 2021 17:30 Hello.
the docker container have this variable: EXRA_CMD_ARG

someone know what is this? what do?
Here you can put extra Domoticz command line arguments https://www.domoticz.com/wiki/Command_line_parameters
Thanks for the info.
I want to lauch a script first time the container runs, lile he init file in the Linuxserver dockers, i thinks this will be similar but not :-(

Thanks

Re: Oficial Docker Container

Posted: Wednesday 04 August 2021 19:27
by anton
Hi,
Now must I set up the network in the compose file?
I have a domoticz container with MQTT port 1883 enabled and a mosquito container
Domoticz say error: MQTT: Connecting to 192.178.1.5:1883
2021-08-04 19:16:18.466 Error: MQTT Gateway: MQTT: Failed to start, return code: 14 (Check IP/Port)

I think that mosquito and domoticz each have another ip adres. The raspberry where the docker is running has 192.178.1.5

Re: Oficial Docker Container

Posted: Wednesday 04 August 2021 20:50
by JackD
To check your Mosquito you can use the mqtt-explorer (http://mqtt-explorer.com/).
Great Windows tool to check your how your Mosquitto server is running.

If Mosquitto and Domoticz are on the same IP then sometimes entering "127.0.0.1"(local) in Domoticz as the IP of the Mosquitto MQTT server will do the trick.

And there are also a few option in the Mosquitto settings file(mosquitto.conf) you have to make, depending on how you set up your system.