mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-18 02:49:01 +02:00
testing
This commit is contained in:
34
README.md
34
README.md
@@ -4,12 +4,12 @@
|
|||||||
|
|
||||||
Source: https://github.com/buanet/docker-iobroker
|
Source: https://github.com/buanet/docker-iobroker
|
||||||
|
|
||||||
IoBroker for Docker is an Dockerimage for ioBroker IoT platform (http://www.iobroker.net).
|
IoBroker for Docker is an Dockerimage for ioBroker IoT platform (http://www.iobroker.net).
|
||||||
|
|
||||||
It is originally made for and always tested on a Synology Disk Station 1515+ with DSM 6 and official Docker package installed. But it also works on other systems with Docker installed!
|
It is originally made for and always tested on a Synology Disk Station 1515+ with DSM 6 and official Docker package installed. But it also works on other systems with Docker installed!
|
||||||
|
|
||||||
Version 4 now supports running the Image in Docker on the following architectures: amd64, armv7hf, aarch64.
|
Version 4 now supports running the Image in Docker on the following architectures: amd64, armv7hf, aarch64.
|
||||||
Feel free to ask for more architectures by opening an github issue.
|
Feel free to ask for more architectures by opening an github issue.
|
||||||
|
|
||||||
## Important notice
|
## Important notice
|
||||||
|
|
||||||
@@ -29,7 +29,7 @@ The following ways to geht iobroker-container running are only examples. Maybe y
|
|||||||
|
|
||||||
### Running from commandline
|
### Running from commandline
|
||||||
|
|
||||||
For taking a first look at the iobroker docker container it would be enough to simply run the following basic docker run command:
|
For taking a first look at the iobroker docker container it would be enough to simply run the following basic docker run command:
|
||||||
|
|
||||||
```
|
```
|
||||||
docker run -p 8081:8081 --name iobroker -v /opt/iobroker:/iobroker buanet/iobroker:latest
|
docker run -p 8081:8081 --name iobroker -v /opt/iobroker:/iobroker buanet/iobroker:latest
|
||||||
@@ -60,11 +60,12 @@ The following will give a short overview.
|
|||||||
|
|
||||||
### Environment variables
|
### Environment variables
|
||||||
|
|
||||||
To configure the ioBroker container on startup it is possible to set some environment variables.
|
To configure the ioBroker container on startup it is possible to set some environment variables.
|
||||||
|
You do not have to declare every single variable when stting up your container. Variables you do not set will come up with their default value.
|
||||||
|
|
||||||
|env|default|description|
|
|env|default|description|
|
||||||
|---|---|---|
|
|---|---|---|
|
||||||
|ADMINPORT|8081|Sets ioBroker adminport on startup|
|
|IOB_ADMINPORT|8081|Sets ioBroker adminport on startup|
|
||||||
|AVAHI|false|Installs and activates avahi-daemon for supporting yahka-adapter, can be "true" or "false"|
|
|AVAHI|false|Installs and activates avahi-daemon for supporting yahka-adapter, can be "true" or "false"|
|
||||||
|LANG|de_DE.UTF‑8|The following locales are pre-generated: de_DE.UTF-8, en_US.UTF-8|
|
|LANG|de_DE.UTF‑8|The following locales are pre-generated: de_DE.UTF-8, en_US.UTF-8|
|
||||||
|LANGUAGE|de_DE:de|The following locales are pre-generated: de_DE:de, en_US:en|
|
|LANGUAGE|de_DE:de|The following locales are pre-generated: de_DE:de, en_US:en|
|
||||||
@@ -77,7 +78,7 @@ To configure the ioBroker container on startup it is possible to set some enviro
|
|||||||
|USBDEVICES|none|Sets relevant permissions on mounted devices like "/dev/ttyACM0", for more than one device separate with ";" like "/dev/ttyACM0;/dev/ttyACM1"|
|
|USBDEVICES|none|Sets relevant permissions on mounted devices like "/dev/ttyACM0", for more than one device separate with ";" like "/dev/ttyACM0;/dev/ttyACM1"|
|
||||||
|ZWAVE|false|Will install openzwave to support zwave-adapter, can be "true" or "false"|
|
|ZWAVE|false|Will install openzwave to support zwave-adapter, can be "true" or "false"|
|
||||||
|
|
||||||
### Mounting Folder/ Volume
|
### Mounting folder/ volume
|
||||||
|
|
||||||
It is possible to mount an empty folder to /opt/iobroker during first startup of the container. The Startupscript will check this folder and restore content if it is empty.
|
It is possible to mount an empty folder to /opt/iobroker during first startup of the container. The Startupscript will check this folder and restore content if it is empty.
|
||||||
Since v4.1.0 it is also possible mount a folder filled up with an iobroker backup file (created with backitup adapter) named like this: "iobroker_2020_01_06-01_09_10_backupiobroker.tar.gz".
|
Since v4.1.0 it is also possible mount a folder filled up with an iobroker backup file (created with backitup adapter) named like this: "iobroker_2020_01_06-01_09_10_backupiobroker.tar.gz".
|
||||||
@@ -88,10 +89,20 @@ Note: It is absolutely recommended to use a mounted folder or persistent volume
|
|||||||
You can also mount a folder containing an existing ioBroker-installation (e.g. when moving an existing installation to docker).
|
You can also mount a folder containing an existing ioBroker-installation (e.g. when moving an existing installation to docker).
|
||||||
But watch for the used node version. If the existing installation runs with another major version of node you have do perform additional steps. For more Details see the "Important notice" on top.
|
But watch for the used node version. If the existing installation runs with another major version of node you have do perform additional steps. For more Details see the "Important notice" on top.
|
||||||
|
|
||||||
### Permission Fixer
|
### Permission fixer
|
||||||
|
|
||||||
After some issues with permissions related to the use of a dedicated user for ioBroker, I added some code for fixing permissions on container startup. This might take a few minutes on first startup. Please take a look at the container logs and be patient!
|
After some issues with permissions related to the use of a dedicated user for ioBroker, I added some code for fixing permissions on container startup. This might take a few minutes on first startup. Please take a look at the container logs and be patient!
|
||||||
|
|
||||||
|
### Userdefined startup scripts (advanced setting/ beta status)
|
||||||
|
|
||||||
|
In some cases it migth be helpful to add some script code to the startup script of the container. This is now possible by mounting an additional folder to the container and place a userscript in there.
|
||||||
|
The folder containing your userscripts must be mounted under /opt/userscripts inside the container. If you mount an empty folder you will get two example scripts to be restored in that folder. Just try it out.
|
||||||
|
|
||||||
|
Basically there are two different scripts which will be read and called by the startup script. One that will only be called once at the first start of the container (userscript_firststart.sh) and one which will be called for every start of the container (userscript_everystart.sh).
|
||||||
|
|
||||||
|
Hint:
|
||||||
|
To get familiar with that feature try the following: Create a Container, mount an empty folder to /opt/userscripts, start your container. Two scripts will be restored into the empty folder. Rename the example scripts by simply removing "_example". Restart your container and take a look at the Log. In "Step 4 of 5: Applying special settings" you will see the messages generated by the example userscripts.
|
||||||
|
|
||||||
## Miscellaneous
|
## Miscellaneous
|
||||||
|
|
||||||
### Keep me updated
|
### Keep me updated
|
||||||
@@ -102,6 +113,7 @@ You will find the channel here: https://t.me/buanet_tutorials
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
### v4.1.2beta (2020-02-02)
|
### v4.1.2beta (2020-02-02)
|
||||||
|
* added feature userscripts on startup
|
||||||
* small fix for permissions issues on some systems
|
* small fix for permissions issues on some systems
|
||||||
* v4.1.1beta (2020-01-17)
|
* v4.1.1beta (2020-01-17)
|
||||||
* updated openzwave to version 1.6.1007
|
* updated openzwave to version 1.6.1007
|
||||||
@@ -112,7 +124,7 @@ You will find the channel here: https://t.me/buanet_tutorials
|
|||||||
* added support to restore backup on startup
|
* added support to restore backup on startup
|
||||||
* small fixes according to "docker best practices"
|
* small fixes according to "docker best practices"
|
||||||
* v4.0.2beta (2019-12-10)
|
* v4.0.2beta (2019-12-10)
|
||||||
* added env for activating redis
|
* ~~added env for activating redis~~
|
||||||
* enhancements in startupscript and dockerfile
|
* enhancements in startupscript and dockerfile
|
||||||
* v4.0.1beta (2019-11-25)
|
* v4.0.1beta (2019-11-25)
|
||||||
* added env for iobroker admin port
|
* added env for iobroker admin port
|
||||||
@@ -147,7 +159,7 @@ You will find the channel here: https://t.me/buanet_tutorials
|
|||||||
* added permission fixing on first start
|
* added permission fixing on first start
|
||||||
* v2.0.5beta (2019-02-09)
|
* v2.0.5beta (2019-02-09)
|
||||||
* added ENV to dockerfile
|
* added ENV to dockerfile
|
||||||
* added EXPOSE for admin
|
* added EXPOSE for admin
|
||||||
* final testing
|
* final testing
|
||||||
* v2.0.4beta (2019-01-28)
|
* v2.0.4beta (2019-01-28)
|
||||||
* added support for env variables "avahi" and "packages"
|
* added support for env variables "avahi" and "packages"
|
||||||
@@ -168,12 +180,12 @@ You will find the channel here: https://t.me/buanet_tutorials
|
|||||||
|
|
||||||
### v2.0.0 (2018-12-05)
|
### v2.0.0 (2018-12-05)
|
||||||
* v1.2.2beta (2018-12-05)
|
* v1.2.2beta (2018-12-05)
|
||||||
* using node8 instead of node6
|
* using node8 instead of node6
|
||||||
* changes for new iobroker setup
|
* changes for new iobroker setup
|
||||||
* v1.2.1beta (2018-09-12)
|
* v1.2.1beta (2018-09-12)
|
||||||
* added support for firetv-adapter
|
* added support for firetv-adapter
|
||||||
|
|
||||||
### v1.2.0 (2018-08-21)
|
### v1.2.0 (2018-08-21)
|
||||||
* v1.1.3beta (2018-08-21)
|
* v1.1.3beta (2018-08-21)
|
||||||
* added ffmpeg-package for yahka to support webcams
|
* added ffmpeg-package for yahka to support webcams
|
||||||
* v1.1.2beta (2018-04-04)
|
* v1.1.2beta (2018-04-04)
|
||||||
|
|||||||
@@ -78,14 +78,19 @@ RUN chsh -s /bin/bash iobroker \
|
|||||||
&& usermod --home /opt/iobroker iobroker
|
&& usermod --home /opt/iobroker iobroker
|
||||||
|
|
||||||
# Setting up ENVs
|
# Setting up ENVs
|
||||||
ENV ADMINPORT=8081 \
|
ENV AVAHI="false" \
|
||||||
AVAHI="false" \
|
|
||||||
DEBIAN_FRONTEND="teletype" \
|
DEBIAN_FRONTEND="teletype" \
|
||||||
|
IOB_ADMINPORT=8081 \
|
||||||
|
IOB_OBJECTSDB_HOST="127.0.0.1" \
|
||||||
|
IOB_OBJECTSDB_PORT="9001" \
|
||||||
|
IOB_OBJECTSDB_TYPE="file" \
|
||||||
|
IOB_STATESDB_HOST="127.0.0.1" \
|
||||||
|
IOB_STATESDB_PORT="9000" \
|
||||||
|
IOB_STATESDB_TYPE="file" \
|
||||||
LANG="de_DE.UTF-8" \
|
LANG="de_DE.UTF-8" \
|
||||||
LANGUAGE="de_DE:de" \
|
LANGUAGE="de_DE:de" \
|
||||||
LC_ALL="de_DE.UTF-8" \
|
LC_ALL="de_DE.UTF-8" \
|
||||||
PACKAGES="vi" \
|
PACKAGES="vi" \
|
||||||
REDIS="false" \
|
|
||||||
SETGID=1000 \
|
SETGID=1000 \
|
||||||
SETUID=1000 \
|
SETUID=1000 \
|
||||||
TZ="Europe/Berlin" \
|
TZ="Europe/Berlin" \
|
||||||
|
|||||||
@@ -1,11 +1,16 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Reading ENV
|
# Reading ENV
|
||||||
adminport=$ADMINPORT
|
adminport=$IOB_ADMINPORT
|
||||||
avahi=$AVAHI
|
avahi=$AVAHI
|
||||||
gid=$SETGID
|
gid=$SETGID
|
||||||
|
objectsdbhost=$IOB_OBJECTSDB_HOST
|
||||||
|
objectsdbport=$IOB_OBJECTSDB_PORT
|
||||||
|
objectsdbtype=$IOB_OBJECTSDB_TYPE
|
||||||
packages=$PACKAGES
|
packages=$PACKAGES
|
||||||
redis=$REDIS
|
statesdbhost=$IOB_STATESDB_HOST
|
||||||
|
statesdbport=$IOB_STATESDB_PORT
|
||||||
|
statesdbtype=$IOB_STATESDB_TYPE
|
||||||
uid=$SETUID
|
uid=$SETUID
|
||||||
usbdevices=$USBDEVICES
|
usbdevices=$USBDEVICES
|
||||||
zwave=$ZWAVE
|
zwave=$ZWAVE
|
||||||
@@ -229,7 +234,7 @@ then
|
|||||||
echo ' '
|
echo ' '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Checking ENV for REDIS
|
# Checking ENVs for custom setup of objects db
|
||||||
if [ "$redis" != "false" ]
|
if [ "$redis" != "false" ]
|
||||||
then
|
then
|
||||||
echo "Connection to Redis is configured by ENV."
|
echo "Connection to Redis is configured by ENV."
|
||||||
@@ -245,13 +250,18 @@ then
|
|||||||
echo ' '
|
echo ' '
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Checking ENVs for custom setup of states db#
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Checking for Userscripts in /opt/userscripts
|
# Checking for Userscripts in /opt/userscripts
|
||||||
if [ `find /opt/userscripts -type f | wc -l` -lt 1 ]
|
if [ `find /opt/userscripts -type f | wc -l` -lt 1 ]
|
||||||
then
|
then
|
||||||
echo "There is no data detected in /opt/userscripts. Restoring exapmple userscripts..."
|
echo "There is no data detected in /opt/userscripts. Restoring exapmple userscripts..."
|
||||||
tar -xf /opt/initial_userscripts.tar -C /
|
tar -xf /opt/initial_userscripts.tar -C /
|
||||||
chmod 755 userscript_firststart_example.sh
|
chmod 755 /opt/userscripts/userscript_firststart_example.sh
|
||||||
chmod 755 userscript_everystart_example.sh
|
chmod 755 /opt/userscripts/userscript_everystart_example.sh
|
||||||
echo "Done."
|
echo "Done."
|
||||||
echo ' '
|
echo ' '
|
||||||
elif [ -f /opt/userscripts/userscript_firststart.sh ] || [ -f /opt/userscripts/userscript_everystart.sh ]
|
elif [ -f /opt/userscripts/userscript_firststart.sh ] || [ -f /opt/userscripts/userscript_everystart.sh ]
|
||||||
@@ -260,7 +270,7 @@ then
|
|||||||
then
|
then
|
||||||
echo "Userscript for first start detected and this is the first start of a new container."
|
echo "Userscript for first start detected and this is the first start of a new container."
|
||||||
echo "Running userscript_firststart.sh..."
|
echo "Running userscript_firststart.sh..."
|
||||||
chmod 755 userscript_firststart.sh
|
chmod 755 /opt/userscripts/userscript_firststart.sh
|
||||||
bash /opt/userscripts/userscript_firststart.sh
|
bash /opt/userscripts/userscript_firststart.sh
|
||||||
rm -f /opt/.firstrun
|
rm -f /opt/.firstrun
|
||||||
echo "Done."
|
echo "Done."
|
||||||
@@ -269,7 +279,7 @@ then
|
|||||||
if [ -f /opt/userscripts/userscript_everystart.sh ]
|
if [ -f /opt/userscripts/userscript_everystart.sh ]
|
||||||
then
|
then
|
||||||
echo "Userscript for every start detected. Running userscript_everystart.sh..."
|
echo "Userscript for every start detected. Running userscript_everystart.sh..."
|
||||||
chmod 755 userscript_everystart.sh
|
chmod 755 /opt/userscripts/userscript_everystart.sh
|
||||||
bash /opt/userscripts/userscript_everystart.sh
|
bash /opt/userscripts/userscript_everystart.sh
|
||||||
echo "Done."
|
echo "Done."
|
||||||
echo ' '
|
echo ' '
|
||||||
|
|||||||
@@ -5,4 +5,9 @@
|
|||||||
|
|
||||||
# You can add your advanced script code here!
|
# You can add your advanced script code here!
|
||||||
|
|
||||||
|
echo ' '
|
||||||
|
echo "I'm your startscript userscript_everystart.sh. I will run on EVERY container startup."
|
||||||
|
echo ' '
|
||||||
|
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
@@ -5,4 +5,8 @@
|
|||||||
|
|
||||||
# You can add your advanced script code here!
|
# You can add your advanced script code here!
|
||||||
|
|
||||||
|
echo ' '
|
||||||
|
echo "I'm your startscript userscript_firststart.sh. I will run only on the FIRST startup of the container."
|
||||||
|
echo ' '
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|||||||
Reference in New Issue
Block a user