mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-17 10:29:00 +02:00
Compare commits
71 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0adbc121e | ||
|
|
17ac1a5bcf | ||
|
|
f440613049 | ||
|
|
7a6de5b3c5 | ||
|
|
0687a2ef18 | ||
|
|
3d191b9fd9 | ||
|
|
0cc07e148d | ||
|
|
f841ccf882 | ||
|
|
b8622098b2 | ||
|
|
9aab687492 | ||
|
|
c69f7145b3 | ||
|
|
1fbbd33979 | ||
|
|
911beabb6a | ||
|
|
945c7bfbaa | ||
|
|
19a6eb74bb | ||
|
|
1713562071 | ||
|
|
a34cdfe7bf | ||
|
|
c0eb88812f | ||
|
|
d3737203dc | ||
|
|
a87286ca08 | ||
|
|
220d07cf95 | ||
|
|
0d740d4626 | ||
|
|
36760c0fac | ||
|
|
42b5720086 | ||
|
|
ced4037317 | ||
|
|
243951e73d | ||
|
|
ea5aa974ce | ||
|
|
b0efc2bc0d | ||
|
|
346ae94e29 | ||
|
|
9d69224aaf | ||
|
|
aa3f15a0d8 | ||
|
|
db16d8af3f | ||
|
|
3de75f273e | ||
|
|
b6c2310364 | ||
|
|
c73b129f1b | ||
|
|
281ac557a4 | ||
|
|
1ae64e4262 | ||
|
|
fd4dad6b1c | ||
|
|
16cf5bedaf | ||
|
|
2cfe6df81c | ||
|
|
3bb6bcf4a2 | ||
|
|
8652a3b546 | ||
|
|
f140ee5280 | ||
|
|
7e438bab0b | ||
|
|
715a1d3a6a | ||
|
|
555619480b | ||
|
|
557786d73f | ||
|
|
09453bf7f6 | ||
|
|
45d3815846 | ||
|
|
e57f50e13e | ||
|
|
651c3a219a | ||
|
|
f45a3e3fe4 | ||
|
|
41c80e8807 | ||
|
|
0369eaaff0 | ||
|
|
53d7a07e78 | ||
|
|
85f4370e25 | ||
|
|
f41bdc5ccf | ||
|
|
23b7b2a434 | ||
|
|
e4bd6c8946 | ||
|
|
9e10615346 | ||
|
|
f91d729b74 | ||
|
|
fe3cee643d | ||
|
|
3e9f3b58c7 | ||
|
|
66ddf35e75 | ||
|
|
f3acd7dc43 | ||
|
|
40673b85bb | ||
|
|
792139283b | ||
|
|
202bdb0a57 | ||
|
|
a4d1aac8b8 | ||
|
|
58921f9773 | ||
|
|
1737e01cb8 |
24
Dockerfile
24
Dockerfile
@@ -4,19 +4,31 @@ MAINTAINER Andre Germann <info@buanet.de>
|
||||
|
||||
ENV DEBIAN_FRONTEND noninteractive
|
||||
|
||||
RUN apt-get update && apt-get install -y apt-utils curl
|
||||
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
|
||||
RUN apt-get update && apt-get install -y apt-utils curl avahi-daemon git libpcap-dev libavahi-compat-libdnssd-dev libfontconfig gnupg2 locales procps libudev-dev unzip sudo
|
||||
RUN sed -i '/^rlimit-nproc/s/^\(.*\)/#\1/g' /etc/avahi/avahi-daemon.conf
|
||||
RUN sed -i -e 's/# de_DE.UTF-8 UTF-8/de_DE.UTF-8 UTF-8/' /etc/locale.gen && \dpkg-reconfigure --frontend=noninteractive locales && \update-locale LANG=de_DE.UTF-8
|
||||
ENV LANG de_DE.UTF-8
|
||||
RUN curl -sL https://deb.nodesource.com/setup_6.x | bash
|
||||
RUN apt-get install -y build-essential python nodejs
|
||||
RUN cp /usr/share/zoneinfo/Europe/Berlin /etc/localtime
|
||||
|
||||
RUN mkdir -p /opt/iobroker/ && chmod 777 /opt/iobroker/
|
||||
RUN mkdir -p /opt/scripts/ && chmod 777 /opt/scripts/
|
||||
|
||||
WORKDIR /opt/scripts/
|
||||
|
||||
ADD scripts/avahi_startup.sh avahi_startup.sh
|
||||
RUN chmod +x avahi_startup.sh
|
||||
RUN mkdir /var/run/dbus/
|
||||
|
||||
ADD scripts/iobroker_startup.sh iobroker_startup.sh
|
||||
RUN chmod +x iobroker_startup.sh
|
||||
|
||||
WORKDIR /opt/iobroker/
|
||||
|
||||
RUN npm install iobroker --unsafe-perm && echo $(hostname) > .install_host
|
||||
RUN update-rc.d iobroker.sh remove
|
||||
|
||||
ADD scripts/startup.sh startup.sh
|
||||
RUN chmod +x startup.sh
|
||||
|
||||
CMD /opt/iobroker/startup.sh
|
||||
CMD ["sh", "/opt/scripts/iobroker_startup.sh"]
|
||||
|
||||
ENV DEBIAN_FRONTEND teletype
|
||||
|
||||
21
LICENSE.txt
Normal file
21
LICENSE.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Andre Germann
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
78
README.md
78
README.md
@@ -1,2 +1,78 @@
|
||||
# docker-iobroker
|
||||
Docker Image for ioBroker based on Debian
|
||||
Docker image for ioBroker (http://iobroker.net) based on debian:latest (http://hub.docker.com/_/debian/)
|
||||
|
||||
This project creates a Docker image for running ioBroker in a Docker container. It is made for and tested on a Synology disk station with DSM 6.0.2 and Docker 1.11.2. But it should also work on other systems running Docker.<br>
|
||||
Cause the container ist based on debian:latest, it acts nearly like a full virtual machine. That makes it possible to easily add some additional dependies for some ioBroker-Adapters.
|
||||
|
||||
## Installation & Usage
|
||||
|
||||
For instructions and discussion (in german) please visit ioBroker-Forum (http://forum.iobroker.net/viewtopic.php?f=17&t=5089).
|
||||
|
||||
## Changelog
|
||||
|
||||
### v1.1.0 (2017-12-10)
|
||||
* changed startup call to fix restart issue
|
||||
* fixed avahi startup issue
|
||||
* fixed hostname issue
|
||||
* added z-wave support
|
||||
* added logging to /opt/scripts/docker_iobroker_log.txt
|
||||
|
||||
### v1.0.1 (2017-08-25)
|
||||
* fixed locales issue
|
||||
|
||||
### v1.0.0 (2017-08-22)
|
||||
* moved and renamed iobroker startup script
|
||||
* disabled iobroker deamon to (hopefully) fix restart issue
|
||||
* added some maintenance scripts
|
||||
|
||||
### v0.2.1 (2017-08-16)
|
||||
* added libfontconfig package (for iobroker.phantomjs)
|
||||
* added gnupg2 package as prerequisite for installing node version 6
|
||||
|
||||
### v0.2.0 (2017-06-04)
|
||||
* fixed startup issue in startup.sh
|
||||
* changed node version from 4 to 6
|
||||
|
||||
### v0.1.2 (2017-03-14)
|
||||
* added libpcap-dev package (for iobroker.amazon-dash)
|
||||
|
||||
### v0.1.1 (2017-03-10)
|
||||
* added git package
|
||||
|
||||
### v0.1.0 (2017-03-08)
|
||||
* moved avahi-start.sh to seperate directory
|
||||
* fixed timezone issue (sets now timezone to Europe/Berlin)
|
||||
|
||||
### v0.0.2 (2017-03-06)
|
||||
* added support for avahi-daemon (installation and autostart)
|
||||
|
||||
### v0.0.1 (2017-01-31)
|
||||
* project started / initial release
|
||||
|
||||
## License
|
||||
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017 Andre Germann
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
## Credits
|
||||
|
||||
Inspired by https://github.com/MehrCurry/docker-iobroker
|
||||
|
||||
84
maintenance_scripts/backup_iobroker_folder.sh
Normal file
84
maintenance_scripts/backup_iobroker_folder.sh
Normal file
@@ -0,0 +1,84 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Backupscript fuer ein Backup von ioBroker unter Docker auf einer Synology Disk Station (Sicherung des ioBroker-Verzeichnises).
|
||||
# Vorhaltezeit der letzten Backups: 90 Tage, ältere Backups werden automatisch geloescht.
|
||||
#
|
||||
# By Andre Germann
|
||||
# Version 1.1 (22.09.2017)
|
||||
#
|
||||
# ACHTUNG: Dieses Script muss vorher auf die Synology Disk Station kopiert und dann auch dort ausgefuehrt werden!
|
||||
# Fuer die geplante, regelmaessige Ausfuehrung bietet sich der Aufgabenplaner der Disk Station an.
|
||||
#
|
||||
# ACHTUNG: Dieses Script stoppt vor der Sicherung des Verzeichnises den ioBroker Container!
|
||||
# Zur Sicherheit wird empfohlen ioBroker vor dem Backup innerhalb des Containers zu stoppen.
|
||||
# Dieses kann zum Beispiel ueber den vorherigen Aufruf des Scripts iobroker_stop.sh aus ioBroker heraus erledigt werden.
|
||||
|
||||
|
||||
# Deklaration der Variablen. Pfade und Bezeichnungen muessen ggf. entsprechend angepasst werden.
|
||||
|
||||
iobrokerPATH='/volume1/docker/iobroker_mount' # Pfad des gemounteten ioBroker-Verzeichnises (zu sicherndes Verzeichnis) auf der Synology Disk Station
|
||||
backupPATH='/volume1/docker/iobroker_backup/archiv' # Pfad zum Speichern des Backups
|
||||
iobrokerCONTAINERNAME='iobroker' # Name des ioBroker-Containers in Docker
|
||||
|
||||
|
||||
# Start Script - Ab hier muss nichts mehr geaendert werden!
|
||||
|
||||
echo "#####################################################"
|
||||
echo "############## Backupscript gestartet. ##############"
|
||||
echo "#####################################################"
|
||||
|
||||
|
||||
### Backup ioBroker-Verzeichnis
|
||||
|
||||
|
||||
# ioBroker-Container stoppen
|
||||
|
||||
echo ""
|
||||
echo "Der ioBroker-Container ($iobrokerCONTAINERNAME) in Docker wird gestoppt..."
|
||||
|
||||
docker stop $iobrokerCONTAINERNAME > /dev/null
|
||||
|
||||
echo "Container in Docker gestoppt."
|
||||
echo ""
|
||||
echo "######################################################"
|
||||
sleep 5
|
||||
|
||||
|
||||
# Backupdatei erstellen
|
||||
|
||||
echo ""
|
||||
echo "Der Ordner $iobrokerPATH wird gesichert..."
|
||||
|
||||
tar -C "$iobrokerPATH" -czf "$backupPATH/backup-$(date +%Y-%m-%d_%H-%M).tar.gz" .
|
||||
|
||||
echo "Sicherung des Ordners erstellt."
|
||||
echo ""
|
||||
echo "######################################################"
|
||||
sleep 5
|
||||
|
||||
|
||||
# Alte Backups loeschen (Loescht per "rm" alle "*.tar.gz"-Dateien im Ordner, die aelter als 90 Tage sind)
|
||||
|
||||
echo ""
|
||||
echo "Entfernen alter Backups aus dem Verzeichnis $backupPATH..."
|
||||
|
||||
find -P "$backupPATH/" -maxdepth 1 -type f \( -name '*.tar.gz' \) -ctime +90 -exec rm {} \;
|
||||
|
||||
echo "Alte Backups wurden entfernt."
|
||||
echo ""
|
||||
echo "######################################################"
|
||||
sleep 5
|
||||
|
||||
|
||||
# ioBroker-Container starten
|
||||
|
||||
echo ""
|
||||
echo "Der ioBroker-Container ($iobrokerCONTAINERNAME) in Docker wird gestartet..."
|
||||
|
||||
docker start $iobrokerCONTAINERNAME > /dev/null
|
||||
|
||||
echo "Container in Docker gestartet."
|
||||
echo ""
|
||||
echo "################### Script Ende ######################"
|
||||
|
||||
exit 0
|
||||
11
maintenance_scripts/iobroker_restart.sh
Normal file
11
maintenance_scripts/iobroker_restart.sh
Normal file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Einfaches Script zum Stoppen von ioBroker.
|
||||
# Kann zum Beispiel aus ioBroker heraus aufgerufen werden um ioBroker neu zu starten.
|
||||
|
||||
cd /opt/iobroker
|
||||
./iobroker stop
|
||||
sleep 5
|
||||
./iobroker start
|
||||
|
||||
exit 0
|
||||
9
maintenance_scripts/iobroker_stop.sh
Normal file
9
maintenance_scripts/iobroker_stop.sh
Normal file
@@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Einfaches Script zum Stoppen von ioBroker.
|
||||
# Kann zum Beispiel aus ioBroker heraus aufgerufen werden um ioBroker zu stoppen.
|
||||
|
||||
cd /opt/iobroker
|
||||
./iobroker stop
|
||||
|
||||
exit 0
|
||||
10
scripts/avahi_startup.sh
Normal file
10
scripts/avahi_startup.sh
Normal file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
rm /var/run/dbus/pid
|
||||
dbus-daemon --system
|
||||
|
||||
/etc/init.d/avahi-daemon stop
|
||||
sleep 5
|
||||
/etc/init.d/avahi-daemon start
|
||||
|
||||
exit 0
|
||||
14
scripts/iobroker_startup.sh
Normal file
14
scripts/iobroker_startup.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/bin/sh
|
||||
|
||||
cd /opt/iobroker
|
||||
|
||||
if [ -f .install_host ];
|
||||
then
|
||||
./iobroker host $(cat .install_host) && echo $(hostname) > .install_host
|
||||
rm .install_host
|
||||
fi
|
||||
|
||||
/opt/scripts/avahi_startup.sh
|
||||
sleep 5
|
||||
node node_modules/iobroker.js-controller/controller.js >/opt/scripts/docker_iobroker_log.txt 2>&1 &
|
||||
/bin/bash
|
||||
@@ -1,9 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
if [ -f .install_host ];
|
||||
then
|
||||
sed -i "s/$(cat .install_host)/$(hostname)/g" iobroker-data/objects.json
|
||||
rm .install_host
|
||||
fi
|
||||
|
||||
node node_modules/iobroker.js-controller/controller.js
|
||||
Reference in New Issue
Block a user