Install and setup Domoticz usig docker container
In my environment this image tested and works in docker on QNAP
docker pull kadasz/image-domoticz
git clone https://github.com/kadasz/image-domoticz.git
cd image-domoticz
docker build -t kadasz/image-domoticz .
NOTE! Is recommended to use docker pull
instead of docker build
because the building process takes a more time so download image from Docker Hub will be much faster.
Pull image from the command line:
docker pull docker.pkg.github.com/kadasz/image-domoticz/image-domoticz:v1.0.0
docker run -d --name domoticz --hostname domoticz -p 8888:8080 kadasz/image-domoticz /sbin/my_init
NOTE! If you want to use image from GitHub Packages, you'll need to add a tag also ie. docker.pkg.github.com/kadasz/image-domoticz/image-domoticz:v1.0.0
You can change the port 8888
to any other one.
First, create the directory on host and set right permissions for it:
mkdir -p ~/domoticz/{logs,plugins,db}
chmod -R o+rxw ~/domoticz/{logs,plugins,db}
Remember, that you can change ~/domoticz/config
as needed for your particular needs!
Next, crete a container hosting the volume mappings:
docker run -d --name domoticz --hostname domoticz --privileged -p 8888:8080 \
-v ~/domoticz/plugins/:/opt/domoticz/plugins \
-v ~/domoticz/logs/:/opt/domoticz/logs \
-v ~/domoticz/db/:/opt/domoticz/db \
kadasz/image-domoticz /sbin/my_init
Now, check that domoticz has started:
docker exec -it domoticz head /opt/domoticz/logs/domoticz.log
you will see output similar to below:
2019-04-25 16:19:07.426 Status: Domoticz V4.9701 (c)2012-2018 GizMoCuz
2019-04-25 16:19:07.433 Status: Build Hash: b47a877f, Date: 2018-06-23 16:27:56
2019-04-25 16:19:07.433 Status: Startup Path: /opt/domoticz/
2019-04-25 16:19:07.472 BuildManifest: Created directory /opt/domoticz/plugins/
2019-04-25 16:19:07.491 Status: PluginSystem: Started, Python version '3.5.2'.
2019-04-25 16:19:07.493 Active notification Subsystems: gcm, http (2/13)
2019-04-25 16:19:07.497 Status: WebServer(HTTP) started on address: 0.0.0.0 with port 8888
or after about one minute run a command"
docker inspect --format '{{.State.Health.Status}}' domoticz
healthy
if you see healthy
, everything works well!
Enter in your browser at address:
http://localhost:8888/
You can set or change environment variables such as:
Parameter | Function |
---|---|
-e TZ=Europe/London |
specify a timezone to use e.g. Europe/London, default is Europe/Warsaw |
- about parent image: https://github.com/phusion/baseimage-docker
- about dockerized service: http://www.domoticz.com