preparing new beta version

This commit is contained in:
buanet
2021-09-04 09:38:35 +02:00
parent 5d3d75292c
commit 718c214210
39 changed files with 330 additions and 2580 deletions

View File

@@ -9,7 +9,7 @@ LABEL org.opencontainers.image.title="ioBroker Docker Image" \
ENV DEBIAN_FRONTEND noninteractive
# Install prerequisites
# Install prerequisites (including node) and generating locales
RUN apt-get update && apt-get install -y \
curl \
gosu \
@@ -19,18 +19,15 @@ RUN apt-get update && apt-get install -y \
sudo \
udev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install node
RUN curl -sL https://deb.nodesource.com/setup_12.x | bash \
# Generating locales
&& sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
# Install node
&& curl -sL https://deb.nodesource.com/setup_12.x | bash \
&& apt-get update && apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Generating locales
RUN sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen
# Create scripts directorys and copy scripts
RUN mkdir -p /opt/scripts/ \
&& mkdir -p /opt/userscripts/ \
@@ -40,7 +37,7 @@ WORKDIR /opt/scripts/
COPY scripts/* ./
RUN chmod +x *.sh
WORKDIR /opt/userscripts/
COPY scripts/* ./
COPY userscripts/* ./
RUN chmod +x *.sh
# Install ioBroker
@@ -51,19 +48,18 @@ RUN apt-get update \
&& echo $(hostname) > /opt/scripts/.docker_config/.install_host \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo $(hostname) > /opt/.firstrun \
# Backup initial ioBroker and userscript folder
&& tar -cf /opt/initial_iobroker.tar /opt/iobroker \
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts \
&& rm -rf /var/lib/apt/lists/*
# Backup initial ioBroker and userscript folder
RUN tar -cf /opt/initial_iobroker.tar /opt/iobroker \
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts
# Setting up iobroker-user (shell and home directory)
RUN chsh -s /bin/bash iobroker \
&& usermod --home /opt/iobroker iobroker \
&& usermod -u 1000 iobroker \
&& groupmod -g 1000 iobroker
# Setting up ENVs
# Setting up default ENVs
ENV DEBIAN_FRONTEND="teletype" \
LANG="de_DE.UTF-8" \
LANGUAGE="de_DE:de" \

View File

@@ -9,7 +9,7 @@ LABEL org.opencontainers.image.title="ioBroker Docker Image" \
ENV DEBIAN_FRONTEND noninteractive
# Install prerequisites
# Install prerequisites (including node) and generating locales
RUN apt-get update && apt-get install -y \
curl \
gosu \
@@ -19,18 +19,15 @@ RUN apt-get update && apt-get install -y \
sudo \
udev \
wget \
&& rm -rf /var/lib/apt/lists/*
# Install node
RUN curl -sL https://deb.nodesource.com/setup_14.x | bash \
# Generating locales
&& sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen \
# Install node
&& curl -sL https://deb.nodesource.com/setup_14.x | bash \
&& apt-get update && apt-get install -y nodejs \
&& rm -rf /var/lib/apt/lists/*
# Generating locales
RUN sed -i 's/^# *\(de_DE.UTF-8\)/\1/' /etc/locale.gen \
&& sed -i 's/^# *\(en_US.UTF-8\)/\1/' /etc/locale.gen \
&& locale-gen
# Create scripts directorys and copy scripts
RUN mkdir -p /opt/scripts/ \
&& mkdir -p /opt/userscripts/ \
@@ -40,7 +37,7 @@ WORKDIR /opt/scripts/
COPY scripts/* ./
RUN chmod +x *.sh
WORKDIR /opt/userscripts/
COPY scripts/* ./
COPY userscripts/* ./
RUN chmod +x *.sh
# Install ioBroker
@@ -51,19 +48,18 @@ RUN apt-get update \
&& echo $(hostname) > /opt/scripts/.docker_config/.install_host \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo $(hostname) > /opt/.firstrun \
# Backup initial ioBroker and userscript folder
&& tar -cf /opt/initial_iobroker.tar /opt/iobroker \
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts \
&& rm -rf /var/lib/apt/lists/*
# Backup initial ioBroker and userscript folder
RUN tar -cf /opt/initial_iobroker.tar /opt/iobroker \
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts
# Setting up iobroker-user (shell and home directory)
RUN chsh -s /bin/bash iobroker \
&& usermod --home /opt/iobroker iobroker \
&& usermod -u 1000 iobroker \
&& groupmod -g 1000 iobroker
# Setting up ENVs
# Setting up default ENVs
ENV DEBIAN_FRONTEND="teletype" \
LANG="de_DE.UTF-8" \
LANGUAGE="de_DE:de" \

View File

@@ -75,12 +75,12 @@ echo "$(printf -- '-%.0s' {1..80})"
echo ' '
# Adding ckeck file for easy docker detection by ioBroker
echo "$VERSION" > /opt/scripts/.docker_config/.thisisdocker
echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker
# Installing/ updating additional packages and setting uid/gid
# Installing/updating additional packages, registering maintenance script and setting uid/gid
if [ "$packages" != "" ] || [ $(cat /etc/group | grep 'iobroker:' | cut -d':' -f3) != $setgid ] || [ $(cat /etc/passwd | grep 'iobroker:' | cut -d':' -f3) != $setuid ] || [ -f /opt/.firstrun ]
then
if [ -f /opt/.firstrun ]
if [ -f /opt/.firstrun ]
then
echo "Updating Linux packages on first run..."
bash /opt/scripts/setup_packages.sh -update
@@ -120,7 +120,7 @@ cd /opt/iobroker
#####
# Detecting ioBroker-Installation
# STEP 2 - Detecting ioBroker-Installation
#####
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 2 of 5: Detecting ioBroker installation -----"
@@ -131,6 +131,8 @@ if [ `find /opt/iobroker -type f | wc -l` -lt 1 ]
then
echo "There is no data detected in /opt/iobroker. Restoring initial ioBroker installation..."
tar -xf /opt/initial_iobroker.tar -C /
# Removing UUID generated on docker image build
iobroker unsetup
echo "Done."
elif [ -f /opt/iobroker/iobroker ]
then
@@ -167,14 +169,14 @@ then
fi
else
echo "There is data detected in /opt/iobroker but it looks like it is no instance of ioBroker or a valid backup file!"
echo "Please check/ recreate mounted folder/ volume and start over."
echo "Please check/ recreate mounted folder or volume and start over."
exit 1
fi
echo ' '
#####
# Checking ioBroker-Installation
# STEP 3 - Checking ioBroker-Installation
#####
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 3 of 5: Checking ioBroker installation -----"
@@ -196,16 +198,8 @@ echo "Fixing \"sudo-bug\" by replacing sudo in iobroker with gosu..."
echo "Done."
echo ' '
# Checking for first run of a new installation and renaming ioBroker
if [ -f /opt/scripts/.docker_config/.install_host ]
then
echo "Looks like this is a new and empty installation of ioBroker."
echo "Hostname needs to be updated to " $(hostname)"..."
bash iobroker host $(cat /opt/scripts/.docker_config/.install_host)
rm -f /opt/scripts/.docker_config/.install_host
echo "Done."
echo ' '
elif [ $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') != $(hostname) ]
# checking hostname in ioBroker to match container hostname
if [ $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') != $(hostname) ]
then
echo "Hostname in ioBroker does not match the hostname of this container."
echo "Updating hostname to " $(hostname)"..."
@@ -214,9 +208,27 @@ then
echo ' '
fi
# Checking for first run of a new installation and renaming ioBroker
#if [ -f /opt/scripts/.docker_config/.install_host ]
#then
# echo "Looks like this is a new and empty installation of ioBroker."
# echo "Hostname needs to be updated to " $(hostname)"..."
# bash iobroker host $(cat /opt/scripts/.docker_config/.install_host)
# rm -f /opt/scripts/.docker_config/.install_host
# echo "Done."
# echo ' '
#elif [ $(bash iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*') != $(hostname) ]
#then
# echo "Hostname in ioBroker does not match the hostname of this container."
# echo "Updating hostname to " $(hostname)"..."
# bash iobroker host $(iobroker object get system.adapter.admin.0 --pretty | grep -oP '(?<="host": ")[^"]*')
# echo "Done."
# echo ' '
#fi
#####
# Setting up prerequisites for some ioBroker-adapters
# STEP 4 - Setting up prerequisites for some ioBroker-adapters
#####
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 4 of 5: Applying special settings -----"
@@ -485,7 +497,7 @@ rm -f /opt/.firstrun
fi
#####
# Starting ioBroker
# STEP 5 - Starting ioBroker
#####
echo "$(printf -- '-%.0s' {1..80})"
echo "----- Step 5 of 5: ioBroker startup -----"