Oficial Docker Container Topic is solved

Subforum for general discussions. Do not dump your questions/problems here, but try to find the subforum where it belongs!

Moderators: leecollings, remb0

knireis
Posts: 16
Joined: Wednesday 09 April 2014 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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.
Chris12
Posts: 238
Joined: Tuesday 18 August 2020 8:41
Target OS: NAS (Synology & others)
Domoticz version: 2021.1
Location: NL
Contact:

Re: Oficial Docker Container

Post 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?
Domoticz beta | Dashticz beta | Synology DS415+ | Wall tablet Teclast 11.6inch (Android) | TADO v3 controlled heating
knireis
Posts: 16
Joined: Wednesday 09 April 2014 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
Gravityz
Posts: 583
Joined: Wednesday 16 December 2015 19:13
Target OS: NAS (Synology & others)
Domoticz version: 2022.2
Location: Netherlands
Contact:

Re: Oficial Docker Container

Post 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
parkerc
Posts: 6
Joined: Sunday 24 April 2016 17:52
Target OS: -
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
pvklink
Posts: 822
Joined: Wednesday 12 November 2014 15:01
Target OS: Raspberry Pi / ODroid
Domoticz version: latest b
Contact:

Re: Oficial Docker Container

Post by pvklink »

which image/docker did you use...
Raspberry (raspbian on rpi 3) , Domoticz Beta, dzVents , RFXtrx433e, P1, Hue, Yeelight, Zwave+, X10, ESP(easy), MQTT,Weather Underground, System Alive Checker, Domoticz Remote Server to RPI with Google Assistant,
Jablotron connection, Ikea
knireis
Posts: 16
Joined: Wednesday 09 April 2014 14:44
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
rezzalex
Posts: 49
Joined: Thursday 24 September 2020 14:30
Target OS: NAS (Synology & others)
Domoticz version: Beta
Contact:

Re: Oficial Docker Container

Post 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.
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Oficial Docker Container

Post 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
antonlamers
Posts: 14
Joined: Wednesday 08 March 2017 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: NL
Contact:

Re: Oficial Docker Container

Post 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
Greating,
Anton
Version: 2023.2
Build Hash: 19efd039c
Compile Date: 2023-07-21 17:23:44
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post by waltervl »

Volumes should be defined as:
volumes:
- <path to domoticz volume>:/opt/domoticz/userdata

eg
- ./volumes/domoticz/data:/opt/domoticz/userdata
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
antonlamers
Posts: 14
Joined: Wednesday 08 March 2017 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: NL
Contact:

Re: Oficial Docker Container

Post 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
Greating,
Anton
Version: 2023.2
Build Hash: 19efd039c
Compile Date: 2023-07-21 17:23:44
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
antonlamers
Posts: 14
Joined: Wednesday 08 March 2017 14:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2021.1
Location: NL
Contact:

Re: Oficial Docker Container

Post 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?
Greating,
Anton
Version: 2023.2
Build Hash: 19efd039c
Compile Date: 2023-07-21 17:23:44
dzVents Version: 3.1.8
Python Version: 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110]
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post 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.
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Oficial Docker Container

Post by DAVIZINHO »

Hello.
the docker container have this variable: EXRA_CMD_ARG

someone know what is this? what do?
User avatar
waltervl
Posts: 5148
Joined: Monday 28 January 2019 18:48
Target OS: Linux
Domoticz version: 2024.7
Location: NL
Contact:

Re: Oficial Docker Container

Post 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
Domoticz running on Udoo X86 (on Ubuntu)
Devices/plugins: ZigbeeforDomoticz (with Xiaomi, Ikea, Tuya devices), Nefit Easy, Midea Airco, Omnik Solar, Goodwe Solar
DAVIZINHO
Posts: 234
Joined: Sunday 27 August 2017 18:00
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: Spain
Contact:

Re: Oficial Docker Container

Post 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
anton
Posts: 6
Joined: Wednesday 30 August 2017 16:15
Target OS: Windows
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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
User avatar
JackD
Posts: 68
Joined: Monday 02 November 2020 20:53
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Oficial Docker Container

Post 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.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest