Compare commits

...

51 Commits

Author SHA1 Message Date
Andre
220d07cf95 Update README.md 2017-08-25 20:49:21 +02:00
Andre
0d740d4626 added locales 2017-08-25 20:47:25 +02:00
Andre
36760c0fac released v1.0.0 2017-08-22 17:07:43 +02:00
Andre
42b5720086 disable iobroker daemon 2017-08-22 15:19:52 +02:00
Andre
ced4037317 Rename scripts/iobroker_stop.sh to maintenance_scripts/iobroker_stop.sh 2017-08-22 15:13:59 +02:00
Andre
243951e73d Rename scripts/iobroker_restart.sh to maintenance_scripts/iobroker_restart.sh 2017-08-22 15:11:35 +02:00
Andre
ea5aa974ce Rename scripts/backup_iobroker_folder.sh to maintenance_scripts/backup_iobroker_folder.sh 2017-08-22 15:11:10 +02:00
Andre
b0efc2bc0d changed location of iobroker startup script 2017-08-22 15:05:54 +02:00
Andre
346ae94e29 renamed avahi startup script 2017-08-22 15:01:25 +02:00
Andre
9d69224aaf Update iobroker_startup.sh 2017-08-22 15:00:04 +02:00
Andre
aa3f15a0d8 renaming avahi startup script 2017-08-22 14:59:17 +02:00
Andre
db16d8af3f Rename avahi-start.sh to avahi_startup.sh 2017-08-22 14:57:49 +02:00
Andre
3de75f273e Update iobroker_restart.sh 2017-08-22 14:56:39 +02:00
Andre
b6c2310364 Update iobroker_stop.sh 2017-08-22 14:56:10 +02:00
Andre
c73b129f1b Update avahi-start.sh 2017-08-22 14:55:52 +02:00
Andre
281ac557a4 Update iobroker_stop.sh 2017-08-22 14:53:57 +02:00
Andre
1ae64e4262 Rename iobroker_restart to iobroker_restart.sh 2017-08-22 14:53:18 +02:00
Andre
fd4dad6b1c Create iobroker_restart 2017-08-22 14:52:56 +02:00
Andre
16cf5bedaf Update iobroker_stop.sh 2017-08-22 14:48:25 +02:00
Andre
2cfe6df81c Update iobroker_startup.sh 2017-08-22 14:46:23 +02:00
Andre
3bb6bcf4a2 Create iobroker_startup.sh 2017-08-21 11:58:09 +02:00
Andre
8652a3b546 Update README.md 2017-08-16 10:04:02 +02:00
Andre
f140ee5280 added gnupg2 package 2017-08-16 10:01:36 +02:00
Andre
7e438bab0b Update README.md 2017-08-16 09:53:37 +02:00
Andre
715a1d3a6a added prerequisite for phantomjs adapter 2017-08-16 09:51:00 +02:00
Andre
555619480b Update README.md 2017-06-04 12:05:06 +02:00
Andre
557786d73f Update README.md 2017-06-04 12:04:14 +02:00
Andre
09453bf7f6 changege nodejs version from 4 to 6 2017-06-04 12:02:15 +02:00
Andre
45d3815846 added sleep 2017-06-04 11:59:21 +02:00
Andre
e57f50e13e Create backup_iobroker_folder.sh 2017-03-22 12:36:35 +01:00
Andre
651c3a219a Create iobroker_stop.sh 2017-03-22 12:23:56 +01:00
Andre
f45a3e3fe4 Update README.md 2017-03-14 16:17:27 +01:00
Andre
41c80e8807 added dependencies for amazon-dash 2017-03-14 16:15:11 +01:00
Andre
0369eaaff0 Update README.md 2017-03-10 09:22:02 +01:00
Andre
53d7a07e78 added git package 2017-03-10 09:20:59 +01:00
Andre
85f4370e25 Update README.md 2017-03-08 21:40:56 +01:00
Andre
f41bdc5ccf fixed timezone issue
this changes timezone setting to Europe/Berlin during build process
2017-03-08 21:37:34 +01:00
Andre
23b7b2a434 moved avahi-start to seperate directory 2017-03-08 21:24:45 +01:00
Andre
e4bd6c8946 moved avahi-start to seperate directory 2017-03-08 21:23:04 +01:00
Andre
9e10615346 released v0.0.2 2017-03-06 20:40:26 +01:00
Andre
f91d729b74 added support for avahi-daemon installation and autostar script 2017-03-06 20:37:47 +01:00
Andre
fe3cee643d added support for avahi-daemon startup script 2017-03-06 20:36:27 +01:00
Andre
3e9f3b58c7 added script for auto starting avahi-daemon 2017-03-06 20:34:58 +01:00
Andre
66ddf35e75 added installation & usage 2017-02-03 15:43:05 +01:00
Andre
f3acd7dc43 added credits 2017-02-02 11:16:58 +01:00
Andre
40673b85bb add license 2017-02-02 11:13:37 +01:00
Andre
792139283b Rename LICENSE to LICENSE.txt 2017-02-02 11:12:16 +01:00
Andre
202bdb0a57 added license 2017-02-02 11:11:51 +01:00
Andre
a4d1aac8b8 changes for starting iobroker as deamon 2017-01-31 18:11:17 +01:00
Andre
58921f9773 changed cmd for calling startup.sh 2017-01-31 18:09:31 +01:00
Andre
1737e01cb8 Update README.md 2017-01-31 18:05:05 +01:00
9 changed files with 242 additions and 9 deletions

View File

@@ -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
View 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.

View File

@@ -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

View 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

View 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

View 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
View 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

View 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

View File

@@ -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