Merge pull request #203 from buanet/dev

v5.3.0-beta1
This commit is contained in:
André Germann
2021-10-07 16:56:38 +02:00
committed by GitHub
12 changed files with 124 additions and 88 deletions

View File

@@ -1 +1 @@
v5.2.0-beta4
v5.3.0-beta1

View File

@@ -50,7 +50,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub
uses: docker/login-action@v1.10.0
@@ -66,7 +66,7 @@ jobs:
password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image (node14-amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -77,7 +77,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-node14-amd64
- name: Build Docker image (node14-arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -88,7 +88,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-node14-arm32v7
- name: Build Docker image (node14-arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -110,7 +110,7 @@ jobs:
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_version-node14.yaml
- name: Delete untagged images from GitHub packages
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PACKAGES_PASS }}
script: |

View File

@@ -50,7 +50,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub
uses: docker/login-action@v1.10.0
@@ -66,7 +66,7 @@ jobs:
password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image (amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -77,7 +77,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-amd64
- name: Build Docker image (arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -88,7 +88,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-arm32v7
- name: Build Docker image (arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -110,7 +110,7 @@ jobs:
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_version.yaml
- name: Delete untagged images from GitHub packages
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PACKAGES_PASS }}
script: |

View File

@@ -46,7 +46,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub
uses: docker/login-action@v1.10.0
@@ -62,7 +62,7 @@ jobs:
password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image (node14-amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -73,7 +73,7 @@ jobs:
ghcr.io/buanet/iobroker:dev-node14-amd64
- name: Build Docker image (node14-arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -84,7 +84,7 @@ jobs:
ghcr.io/buanet/iobroker:dev-node14-arm32v7
- name: Build Docker image (node14-arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node14/Dockerfile
@@ -102,7 +102,7 @@ jobs:
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_dev-node14.yaml
- name: Delete untagged images from GitHub packages
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PACKAGES_PASS }}
script: |

View File

@@ -46,7 +46,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub
uses: docker/login-action@v1.10.0
@@ -62,7 +62,7 @@ jobs:
password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image (amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -73,7 +73,7 @@ jobs:
ghcr.io/buanet/iobroker:dev-amd64
- name: Build Docker image (arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -84,7 +84,7 @@ jobs:
ghcr.io/buanet/iobroker:dev-arm32v7
- name: Build Docker image (arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -102,7 +102,7 @@ jobs:
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_dev.yaml
- name: Delete untagged images from GitHub packages
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PACKAGES_PASS }}
script: |

View File

@@ -48,7 +48,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub (buanet)
uses: docker/login-action@v1.10.0
@@ -64,7 +64,7 @@ jobs:
password: ${{ secrets.PACKAGES_PASS }}
- name: Build Docker image (amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -75,7 +75,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-amd64
- name: Build Docker image (arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -86,7 +86,7 @@ jobs:
ghcr.io/buanet/iobroker:${{ env.version }}-arm32v7
- name: Build Docker image (arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -112,7 +112,7 @@ jobs:
./manifest-tool --username ${{ secrets.PACKAGES_USER }} --password ${{ secrets.PACKAGES_PASS }} push from-spec manifest_ghcr_version.yaml
- name: Delete untagged images from GitHub packages
uses: actions/github-script@v3
uses: actions/github-script@v5
with:
github-token: ${{ secrets.PACKAGES_PASS }}
script: |

View File

@@ -48,7 +48,7 @@ jobs:
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v1.5.1
uses: docker/setup-buildx-action@v1.6.0
- name: Login to DockerHub (iobroker)
uses: docker/login-action@v1.10.0
@@ -57,7 +57,7 @@ jobs:
password: ${{ secrets.DOCKER_PASS_IOB }}
- name: Build Docker image (amd64)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -67,7 +67,7 @@ jobs:
iobroker/iobroker:${{ env.version }}-amd64,
- name: Build Docker image (arm32v7)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile
@@ -77,7 +77,7 @@ jobs:
iobroker/iobroker:${{ env.version }}-arm32v7,
- name: Build Docker image (arm64v8)
uses: docker/build-push-action@v2.6.1
uses: docker/build-push-action@v2.7.0
with:
context: ./debian
file: ./debian/node12/Dockerfile

View File

@@ -1,10 +1,17 @@
## Changelog
### v5.2.0-beta4 (2021-09-10)
* adding iobroker user rights for "gosu"
* adding more labels in OCI standard format
* fixing workdir bug
* adding backitup compatibility
### v5.3.0-beta1 (2021-10-07)
* adding check for PACKAGES on startup (#201)
* adding packages for discovery
* adding packages for backitup
* reorganizing Dockerfile
### v5.2.0 (2021-09-30)
* v5.2.0-beta4 (2021-09-10)
* adding iobroker user rights for "gosu"
* adding more labels in OCI standard format
* fixing workdir bug
* adding backitup compatibility
* v5.2.0-beta3 (2021-09-04)
* reducing layers in dockerfile
* making hostname check mandatory for startup

View File

@@ -14,39 +14,42 @@ ENV DEBIAN_FRONTEND noninteractive
# Install prerequisites (including node) and generating locales
RUN apt-get update && apt-get install -y \
apt-utils \
cifs-utils \
curl \
gosu \
iputils-ping \
jq \
locales \
nfs-common \
procps \
python3 \
python3-dev \
sudo \
tar \
tzdata \
udev \
wget \
# 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/*
# Install node-gyp
&& npm install -g node-gyp \
# 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
# Create scripts directorys and copy scripts
RUN mkdir -p /opt/scripts/ \
&& mkdir -p /opt/userscripts/ \
&& chmod 777 /opt/scripts/ \
&& chmod 777 /opt/userscripts/
WORKDIR /opt/scripts/
COPY scripts/* ./
RUN chmod +x *.sh
WORKDIR /opt/userscripts/
COPY userscripts/* ./
RUN chmod +x *.sh
# Create directorys and copy scripts
COPY scripts /opt/scripts
COPY userscripts /opt/userscripts
RUN chmod 777 /opt/scripts/ \
&& chmod 777 /opt/userscripts/ \
&& chmod +x /opt/scripts/*.sh \
&& chmod +x /opt/userscripts/*.sh
# Install ioBroker
WORKDIR /
RUN apt-get update \
&& curl -sL https://iobroker.net/install.sh | bash - \
RUN curl -sL https://iobroker.net/install.sh | bash - \
&& mkdir -p /opt/scripts/.docker_config/ \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
@@ -56,15 +59,20 @@ RUN apt-get update \
# 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/*
# Setting up iobroker-user (shell, home dir and rights)
RUN chsh -s /bin/bash iobroker \
# Setting up iobroker-user (shell, home dir and rights)
&& chsh -s /bin/bash iobroker \
&& usermod --home /opt/iobroker iobroker \
&& usermod -u 1000 iobroker \
&& groupmod -g 1000 iobroker \
&& chown root:iobroker /usr/sbin/gosu \
&& chmod +s /usr/sbin/gosu
&& chmod +s /usr/sbin/gosu \
# Clean up installation cache
&& apt-get autoclean -y \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /root/.cache/* /root/.npm/* \
&& rm -rf /var/lib/apt/lists/*
# Setting up default ENVs
ENV DEBIAN_FRONTEND="teletype" \

View File

@@ -14,39 +14,42 @@ ENV DEBIAN_FRONTEND noninteractive
# Install prerequisites (including node) and generating locales
RUN apt-get update && apt-get install -y \
apt-utils \
cifs-utils \
curl \
gosu \
iputils-ping \
jq \
locales \
nfs-common \
procps \
python3 \
python3-dev \
sudo \
tar \
tzdata \
udev \
wget \
# 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/*
# Install node-gyp
&& npm install -g node-gyp \
# 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
# Create scripts directorys and copy scripts
RUN mkdir -p /opt/scripts/ \
&& mkdir -p /opt/userscripts/ \
&& chmod 777 /opt/scripts/ \
&& chmod 777 /opt/userscripts/
WORKDIR /opt/scripts/
COPY scripts/* ./
RUN chmod +x *.sh
WORKDIR /opt/userscripts/
COPY userscripts/* ./
RUN chmod +x *.sh
# Create directorys and copy scripts
COPY scripts /opt/scripts
COPY userscripts /opt/userscripts
RUN chmod 777 /opt/scripts/ \
&& chmod 777 /opt/userscripts/ \
&& chmod +x /opt/scripts/*.sh \
&& chmod +x /opt/userscripts/*.sh
# Install ioBroker
WORKDIR /
RUN apt-get update \
&& curl -sL https://iobroker.net/install.sh | bash - \
RUN curl -sL https://iobroker.net/install.sh | bash - \
&& mkdir -p /opt/scripts/.docker_config/ \
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
@@ -56,15 +59,20 @@ RUN apt-get update \
# 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/*
# Setting up iobroker-user (shell, home dir and rights)
RUN chsh -s /bin/bash iobroker \
# Setting up iobroker-user (shell, home dir and rights)
&& chsh -s /bin/bash iobroker \
&& usermod --home /opt/iobroker iobroker \
&& usermod -u 1000 iobroker \
&& groupmod -g 1000 iobroker \
&& chown root:iobroker /usr/sbin/gosu \
&& chmod +s /usr/sbin/gosu
&& chmod +s /usr/sbin/gosu \
# Clean up installation cache
&& apt-get autoclean -y \
&& apt-get autoremove \
&& apt-get clean \
&& rm -rf /tmp/* /var/tmp/* \
&& rm -rf /root/.cache/* /root/.npm/* \
&& rm -rf /var/lib/apt/lists/*
# Setting up default ENVs
ENV DEBIAN_FRONTEND="teletype" \

View File

@@ -92,8 +92,8 @@ then
if [ "$packages" != "" ]
then
echo "Installing additional packages is set by ENV."
echo "The following packages will be installed:" $packages"..."
echo $packages > /opt/scripts/.packages
echo "Checking the following Packages:" $packages"..."
echo $packages > /opt/scripts/.docker_config/.packages
bash /opt/scripts/setup_packages.sh -install
echo "Done."
echo ' '

View File

@@ -3,9 +3,16 @@
if [ $1 == "-install" ]
then
apt-get -qq update
packages=$(cat /opt/scripts/.packages)
packages=$(cat /opt/scripts/.docker_config/.packages)
for i in $packages; do
sudo apt-get -qq -y install $i
if [ $(dpkg-query -W -f='${Status}' $i 2>/dev/null | grep -c "ok installed") -eq 0 ];
then
echo "$i is not installed. Installing..."
sudo apt-get -qq -y install $i
echo "Done."
else
echo "$i is already installed."
fi
done
elif [ $1 == "-update" ]
then
@@ -16,7 +23,13 @@ else
exit 1
fi
# Cleanup
apt-get autoclean -y
apt-get autoremove
apt-get clean
rm -rf /tmp/* /var/tmp/*
rm -rf /root/.cache/*
rm -rf /var/lib/apt/lists/*
rm -f /opt/scripts/.packages
rm -f /opt/scripts/.docker_config/.packages
exit 0