mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-17 18:39:01 +02:00
Compare commits
51 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
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 |
23
Dockerfile
23
Dockerfile
@@ -4,19 +4,30 @@ MAINTAINER Andre Germann <info@buanet.de>
|
|||||||
|
|
||||||
ENV DEBIAN_FRONTEND noninteractive
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
RUN apt-get update && apt-get install -y apt-utils curl
|
RUN apt-get update && apt-get install -y apt-utils curl avahi-daemon git libpcap-dev libavahi-compat-libdnssd-dev libfontconfig gnupg2 locales
|
||||||
RUN curl -sL https://deb.nodesource.com/setup_4.x | bash
|
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 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/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/
|
WORKDIR /opt/iobroker/
|
||||||
|
|
||||||
RUN npm install iobroker --unsafe-perm && echo $(hostname) > .install_host
|
RUN npm install iobroker --unsafe-perm && echo $(hostname) > .install_host
|
||||||
|
RUN update-rc.d iobroker.sh disable
|
||||||
|
|
||||||
ADD scripts/startup.sh startup.sh
|
CMD ["sh", "/opt/scripts/iobroker_startup.sh"]
|
||||||
RUN chmod +x startup.sh
|
|
||||||
|
|
||||||
CMD /opt/iobroker/startup.sh
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND teletype
|
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.
|
||||||
71
README.md
71
README.md
@@ -1,2 +1,71 @@
|
|||||||
# docker-iobroker
|
# 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.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 für ein (wöchentliches) Backup von ioBroker unter Docker auf einer Synology Disk Station (Sicherung des ioBroker-Verzeichnises).
|
||||||
|
# Vorhaltezeit der letzten Backups: 90 Tage, ältere Backups werden automatisch gelöscht.
|
||||||
|
#
|
||||||
|
# By André Germann
|
||||||
|
# Version 1.0 (22.03.2017)
|
||||||
|
#
|
||||||
|
# ACHTUNG: Dieses Script muss vorher auf die Synology Disk Station kopiert und dann auch dort ausgeführt werden!
|
||||||
|
# Für die geplante, regelmäßige Ausführung 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 über den vorherigen Aufruf des Scripts iobroker_stop.sh aus ioBroker heraus erledigt werden.
|
||||||
|
|
||||||
|
|
||||||
|
# Deklaration der Variablen. Pfade und Bezeichnungen müssen ggf. entsprechend angepasst werden.
|
||||||
|
|
||||||
|
iobrokerPATH='/volume1/docker/mount/iobroker' # Pfad des gemounteten ioBroker-Verzeichnises (zu sicherndes Verzeichnis) auf der Synology Disk Station
|
||||||
|
backupPATH='/volume1/backup/Homeautomation/iobroker/backup.weekly' # Pfad zum Speichern des Backups
|
||||||
|
iobrokerCONTAINERNAME='iobroker' # Name des ioBroker-Containers in Docker
|
||||||
|
|
||||||
|
|
||||||
|
# Start Script - Ab hier muss nichts mehr geändert 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 -czf "$backupPATH/backup-$(date +%d.%m.%y-%R).tar.gz" "$iobrokerPATH"
|
||||||
|
|
||||||
|
echo "Sicherung des Ordners erstellt."
|
||||||
|
echo ""
|
||||||
|
echo "######################################################"
|
||||||
|
sleep 5
|
||||||
|
|
||||||
|
|
||||||
|
# Alte Backups löschen (Löscht per "rm" alle "*.tar.gz"-Dateien im Ordner, die älter als 90 Tage sind)
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "Entfernen alter Backups aus dem Verzeichnis $backupPATH..."
|
||||||
|
|
||||||
|
find -P "$backupPATH/" -maxdepth 1 -type f \( -name '*.tar.gz' \) -ctime +19 -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
|
||||||
|
|
||||||
|
if [ -f .install_host ];
|
||||||
|
then
|
||||||
|
sed -i "s/$(cat .install_host)/$(hostname)/g" iobroker-data/objects.json
|
||||||
|
rm .install_host
|
||||||
|
fi
|
||||||
|
|
||||||
|
/opt/scripts/avahi_startup.sh
|
||||||
|
sleep 5
|
||||||
|
cd /opt/iobroker
|
||||||
|
./iobroker start
|
||||||
|
cd /
|
||||||
|
/bin/bash
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/sh
|
||||||
|
|
||||||
if [ -f .install_host ];
|
if [ -f .install_host ];
|
||||||
then
|
then
|
||||||
@@ -6,4 +6,8 @@ then
|
|||||||
rm .install_host
|
rm .install_host
|
||||||
fi
|
fi
|
||||||
|
|
||||||
node node_modules/iobroker.js-controller/controller.js
|
/opt/scripts/avahi_startup.sh
|
||||||
|
sleep 5
|
||||||
|
./iobroker start
|
||||||
|
cd /
|
||||||
|
/bin/bash
|
||||||
|
|||||||
Reference in New Issue
Block a user