mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-17 18:39:01 +02:00
Compare commits
32 Commits
v8.0.1
...
v8.1.0-bet
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4fe9c10771 | ||
|
|
3d83c7fa21 | ||
|
|
f225536852 | ||
|
|
18b0f863bd | ||
|
|
ff6535a896 | ||
|
|
3543b10c90 | ||
|
|
b3870bdcb7 | ||
|
|
9f016f5363 | ||
|
|
800e95a5c2 | ||
|
|
0f3b59fe98 | ||
|
|
8f7f9656d8 | ||
|
|
7e291f98ea | ||
|
|
a46e29fac1 | ||
|
|
8294f8cf51 | ||
|
|
5c7dfb3d3c | ||
|
|
721c108742 | ||
|
|
7a455952dd | ||
|
|
a04f210190 | ||
|
|
0f59839695 | ||
|
|
4f15a4df23 | ||
|
|
686b391119 | ||
|
|
d5a6596070 | ||
|
|
8c9279b867 | ||
|
|
065d0cb4df | ||
|
|
acad72922e | ||
|
|
8fe4d775f5 | ||
|
|
e283d25710 | ||
|
|
893908f29d | ||
|
|
16e30c392d | ||
|
|
a954b51223 | ||
|
|
6a55923669 | ||
|
|
bbac132f28 |
2
.github/dependencies/.backitup-version
vendored
2
.github/dependencies/.backitup-version
vendored
@@ -1 +1 @@
|
|||||||
2.6.16
|
2.6.23
|
||||||
|
|||||||
@@ -39,37 +39,42 @@ jobs:
|
|||||||
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image (node20)
|
- name: Build Docker image (node20)
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node20/Dockerfile
|
file: ./debian/node20/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm/v7
|
||||||
|
linux/arm64/v8
|
||||||
tags: |
|
tags: |
|
||||||
buanet/iobroker:beta-node20,
|
buanet/iobroker:beta-node20,
|
||||||
buanet/iobroker:${{ env.version }}-node20,
|
buanet/iobroker:${{ env.version }}-node20,
|
||||||
ghcr.io/buanet/iobroker:beta-node20,
|
ghcr.io/buanet/iobroker:beta-node20,
|
||||||
ghcr.io/buanet/iobroker:${{ env.version }}-node20
|
ghcr.io/buanet/iobroker:${{ env.version }}-node20
|
||||||
|
provenance: false
|
||||||
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|
||||||
|
|
||||||
- name: Delete untagged images from GitHub packages
|
- name: Delete untagged images from GitHub packages
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-beta.yml
vendored
10
.github/workflows/build-debian-image-beta.yml
vendored
@@ -39,27 +39,27 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repo
|
- name: Checkout repo
|
||||||
uses: actions/checkout@v3
|
uses: actions/checkout@v3.5.0
|
||||||
with:
|
with:
|
||||||
repository: 'buanet/ioBroker.docker'
|
repository: 'buanet/ioBroker.docker'
|
||||||
|
|
||||||
- name: Fetching version tag and date
|
- name: Fetch version tag and date
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
VERSION="$(cat .VERSION)"
|
VERSION="$(cat .VERSION)"
|
||||||
@@ -33,38 +33,43 @@ jobs:
|
|||||||
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
mv -f ./debian/node20/Dockerfile.tmp ./debian/node20/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image (node20)
|
- name: Build Docker image (node20)
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node20/Dockerfile
|
file: ./debian/node20/Dockerfile
|
||||||
push: true
|
push: true
|
||||||
platforms: linux/amd64,linux/arm/v7,linux/arm64/v8
|
platforms: |
|
||||||
|
linux/amd64
|
||||||
|
linux/arm/v7
|
||||||
|
linux/arm64/v8
|
||||||
tags: |
|
tags: |
|
||||||
buanet/iobroker:dev-node20,
|
buanet/iobroker:dev-node20,
|
||||||
ghcr.io/buanet/iobroker:dev-node20
|
ghcr.io/buanet/iobroker:dev-node20
|
||||||
|
provenance: false
|
||||||
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|
||||||
|
|
||||||
- name: Delete untagged images from GitHub packages
|
- name: Delete untagged images from GitHub Container Registry
|
||||||
uses: actions/github-script@v6
|
uses: actions/github-script@v6.4.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.PACKAGES_PASS }}
|
github-token: ${{ secrets.PACKAGES_PASS }}
|
||||||
script: |
|
script: |
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-dev.yml
vendored
10
.github/workflows/build-debian-image-dev.yml
vendored
@@ -33,27 +33,27 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub
|
- name: Login to DockerHub
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
@@ -42,20 +42,20 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
|
|
||||||
- name: Login to DockerHub (iobroker)
|
- name: Login to DockerHub (iobroker)
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER_IOB }}
|
username: ${{ secrets.DOCKER_USER_IOB }}
|
||||||
password: ${{ secrets.DOCKER_PASS_IOB }}
|
password: ${{ secrets.DOCKER_PASS_IOB }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
10
.github/workflows/build-debian-image-latest.yml
vendored
10
.github/workflows/build-debian-image-latest.yml
vendored
@@ -42,26 +42,26 @@ jobs:
|
|||||||
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
mv -f ./debian/node18/Dockerfile.tmp ./debian/node18/Dockerfile
|
||||||
|
|
||||||
- name: Set up QEMU
|
- name: Set up QEMU
|
||||||
uses: docker/setup-qemu-action@v2.1.0
|
uses: docker/setup-qemu-action@v2.2.0
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
id: buildx
|
id: buildx
|
||||||
uses: docker/setup-buildx-action@v2.5.0
|
uses: docker/setup-buildx-action@v2.8.0
|
||||||
- name: Login to DockerHub (buanet)
|
- name: Login to DockerHub (buanet)
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASS }}
|
password: ${{ secrets.DOCKER_PASS }}
|
||||||
|
|
||||||
- name: Login to GitHub Container Registry
|
- name: Login to GitHub Container Registry
|
||||||
uses: docker/login-action@v2.1.0
|
uses: docker/login-action@v2.2.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ secrets.PACKAGES_USER }}
|
username: ${{ secrets.PACKAGES_USER }}
|
||||||
password: ${{ secrets.PACKAGES_PASS }}
|
password: ${{ secrets.PACKAGES_PASS }}
|
||||||
|
|
||||||
- name: Build Docker image
|
- name: Build Docker image
|
||||||
uses: docker/build-push-action@v4.0.0
|
uses: docker/build-push-action@v4.1.1
|
||||||
with:
|
with:
|
||||||
context: ./debian
|
context: ./debian
|
||||||
file: ./debian/node18/Dockerfile
|
file: ./debian/node18/Dockerfile
|
||||||
|
|||||||
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,5 +1,20 @@
|
|||||||
## Changelog
|
## Changelog
|
||||||
|
|
||||||
|
### v8.1.0-beta.3 (05.07.2023)
|
||||||
|
* fix permission issue for restart container as iobroker user
|
||||||
|
* fix issue with js-controller ui upgrade
|
||||||
|
* fix small issues in maintenance script
|
||||||
|
* update action workflows
|
||||||
|
* v8.1.0-beta.2 (26.04.2023)
|
||||||
|
* prohibit restore when startup script is still running
|
||||||
|
* extend time before restart after restore is done
|
||||||
|
* influx data repo will be added automatically when PACKAGES contains influxdb or influxdb2-cli package
|
||||||
|
* v8.1.0-beta.1 (14.04.2023)
|
||||||
|
* enhance github actions
|
||||||
|
* enhance log output of maintenance script on restore ([#333](https://github.com/buanet/ioBroker.docker/issues/333))
|
||||||
|
* allow iobroker admin to be disabled at startup ([#332](https://github.com/buanet/ioBroker.docker/issues/332))
|
||||||
|
* allow deletion of objects and states db password with value "none" ([#306](https://github.com/buanet/ioBroker.docker/issues/306))
|
||||||
|
|
||||||
### v8.0.1 (17.04.2023)
|
### v8.0.1 (17.04.2023)
|
||||||
* fix calling of "iob setup first" on slaves ([#335](https://github.com/buanet/ioBroker.docker/issues/335))
|
* fix calling of "iob setup first" on slaves ([#335](https://github.com/buanet/ioBroker.docker/issues/335))
|
||||||
|
|
||||||
|
|||||||
102
debian/node20/Dockerfile
vendored
Normal file
102
debian/node20/Dockerfile
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
FROM debian:bullseye-slim
|
||||||
|
|
||||||
|
LABEL org.opencontainers.image.title="Official ioBroker Docker Image" \
|
||||||
|
org.opencontainers.image.description="Official Docker image for ioBroker smarthome software (https://www.iobroker.net)" \
|
||||||
|
org.opencontainers.image.documentation="https://github.com/buanet/ioBroker.docker#readme" \
|
||||||
|
org.opencontainers.image.authors="André Germann <info@buanet.de>" \
|
||||||
|
org.opencontainers.image.url="https://github.com/buanet/ioBroker.docker" \
|
||||||
|
org.opencontainers.image.source="https://github.com/buanet/ioBroker.docker" \
|
||||||
|
org.opencontainers.image.base.name="docker.io/library/debian:bullseye-slim" \
|
||||||
|
org.opencontainers.image.version="${VERSION}" \
|
||||||
|
org.opencontainers.image.created="${DATI}"
|
||||||
|
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
|
||||||
|
# Copy scripts
|
||||||
|
COPY scripts /opt/scripts
|
||||||
|
COPY userscripts /opt/userscripts
|
||||||
|
|
||||||
|
# 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 \
|
||||||
|
# Install node
|
||||||
|
&& curl -sL https://deb.nodesource.com/setup_20.x | bash \
|
||||||
|
&& apt-get update && apt-get install -y nodejs \
|
||||||
|
# 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 \
|
||||||
|
# Change permissions for scripts
|
||||||
|
&& chmod 777 /opt/scripts/ \
|
||||||
|
&& chmod 777 /opt/userscripts/ \
|
||||||
|
&& chmod +x /opt/scripts/*.sh \
|
||||||
|
&& chmod +x /opt/userscripts/*.sh \
|
||||||
|
# Prepare
|
||||||
|
&& mkdir -p /opt/scripts/.docker_config/ \
|
||||||
|
&& echo "starting" > /opt/scripts/.docker_config/.healthcheck \
|
||||||
|
&& echo "${VERSION}" > /opt/scripts/.docker_config/.thisisdocker \
|
||||||
|
&& echo "true" > /opt/.first_run \
|
||||||
|
# Run installer
|
||||||
|
&& curl -sL https://iobroker.net/install.sh | bash - \
|
||||||
|
# Deleting UUID from build
|
||||||
|
&& iobroker unsetup -y \
|
||||||
|
&& echo "true" > /opt/iobroker/.fresh_install \
|
||||||
|
# Backup initial ioBroker and userscript folder
|
||||||
|
&& tar -cf /opt/initial_iobroker.tar /opt/iobroker \
|
||||||
|
&& tar -cf /opt/initial_userscripts.tar /opt/userscripts \
|
||||||
|
# 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 \
|
||||||
|
# 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" \
|
||||||
|
LANG="de_DE.UTF-8" \
|
||||||
|
LANGUAGE="de_DE:de" \
|
||||||
|
LC_ALL="de_DE.UTF-8" \
|
||||||
|
SETGID=1000 \
|
||||||
|
SETUID=1000 \
|
||||||
|
TZ="Europe/Berlin"
|
||||||
|
|
||||||
|
# Expose default admin ui port
|
||||||
|
EXPOSE 8081
|
||||||
|
|
||||||
|
# Change work dir
|
||||||
|
WORKDIR /opt/iobroker/
|
||||||
|
|
||||||
|
# Healthcheck
|
||||||
|
HEALTHCHECK --interval=15s --timeout=5s --retries=5 \
|
||||||
|
CMD ["/bin/bash", "-c", "/opt/scripts/healthcheck.sh"]
|
||||||
|
|
||||||
|
# Volumes for persistent data
|
||||||
|
VOLUME ["/opt/iobroker"]
|
||||||
|
|
||||||
|
# Run startup-script
|
||||||
|
ENTRYPOINT ["/bin/bash", "-c", "/opt/scripts/iobroker_startup.sh"]
|
||||||
3
debian/scripts/iobroker_startup.sh
vendored
3
debian/scripts/iobroker_startup.sh
vendored
@@ -143,9 +143,10 @@ if [[ -f /opt/.first_run ]]; then
|
|||||||
echo "PACKAGES is set, but OFFLINE_MODE is \"true\". Skipping Linux package installation."
|
echo "PACKAGES is set, but OFFLINE_MODE is \"true\". Skipping Linux package installation."
|
||||||
elif [[ "$packages" != "" ]]; then
|
elif [[ "$packages" != "" ]]; then
|
||||||
echo "PACKAGES is set. Installing the following additional Linux packages: ""$packages"
|
echo "PACKAGES is set. Installing the following additional Linux packages: ""$packages"
|
||||||
echo "$packages" > /opt/scripts/.docker_config/.packages
|
# echo "$packages" > /opt/scripts/.docker_config/.packages
|
||||||
bash /opt/scripts/setup_packages.sh -install
|
bash /opt/scripts/setup_packages.sh -install
|
||||||
fi
|
fi
|
||||||
|
echo ' '
|
||||||
# Register maintenance script
|
# Register maintenance script
|
||||||
echo -n 'Registering maintenance script as command... '
|
echo -n 'Registering maintenance script as command... '
|
||||||
echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
|
echo "alias maintenance=\'/opt/scripts/maintenance.sh\'" >> /root/.bashrc
|
||||||
|
|||||||
115
debian/scripts/maintenance.sh
vendored
115
debian/scripts/maintenance.sh
vendored
@@ -38,6 +38,11 @@ maintenance_enabled() {
|
|||||||
[[ -f "$healthcheck" && "$(cat "$healthcheck")" == maintenance ]]
|
[[ -f "$healthcheck" && "$(cat "$healthcheck")" == maintenance ]]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# check status starting
|
||||||
|
check_starting() {
|
||||||
|
[[ -f "$healthcheck" && "$(cat "$healthcheck")" == starting ]]
|
||||||
|
}
|
||||||
|
|
||||||
# display maintenance status
|
# display maintenance status
|
||||||
maintenance_status() {
|
maintenance_status() {
|
||||||
if maintenance_enabled; then
|
if maintenance_enabled; then
|
||||||
@@ -54,40 +59,24 @@ enable_maintenance() {
|
|||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$killbyname" == yes ]]; then
|
|
||||||
# undocumented option, only for use with backitup restore scripts
|
|
||||||
# stops iobroker by terminating js-controller process by name (the old way)
|
|
||||||
echo 'This command will activate maintenance mode and stop js-controller.'
|
|
||||||
echo 'Activating maintenance mode...'
|
|
||||||
echo 'maintenance' > "$healthcheck"
|
|
||||||
sleep 1
|
|
||||||
echo 'Done.'
|
|
||||||
echo -n 'Stopping ioBroker...'
|
|
||||||
pkill -u iobroker -f iobroker.js-controller
|
|
||||||
sleep 5
|
|
||||||
echo 'Done.'
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
|
echo 'You are now going to stop ioBroker and activate maintenance mode for this container.'
|
||||||
|
|
||||||
if [[ "$autoconfirm" != yes ]]; then
|
if [[ "$killbyname" != yes ]]; then
|
||||||
local reply
|
if [[ "$autoconfirm" != yes ]]; then
|
||||||
|
local reply
|
||||||
|
|
||||||
read -rp 'Do you want to continue [yes/no]? ' reply
|
read -rp 'Do you want to continue [yes/no]? ' reply
|
||||||
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
|
if [[ "$reply" == y || "$reply" == Y || "$reply" == yes ]]; then
|
||||||
: # continue
|
: # continue
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Activating maintenance mode...'
|
echo 'Activating maintenance mode...'
|
||||||
echo 'maintenance' > "$healthcheck"
|
echo 'maintenance' > "$healthcheck"
|
||||||
sleep 1
|
sleep 1
|
||||||
echo 'Done.'
|
|
||||||
echo -n 'Stopping ioBroker...'
|
echo -n 'Stopping ioBroker...'
|
||||||
stop_iob
|
stop_iob
|
||||||
}
|
}
|
||||||
@@ -111,13 +100,11 @@ disable_maintenance() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo 'Deactivating maintenance mode and forcing container to stop or restart...'
|
echo 'Deactivating maintenance mode and forcing container to stop or restart...'
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
echo 'Done.'
|
echo 'Done.'
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -137,8 +124,6 @@ upgrade_jscontroller() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! maintenance_enabled > /dev/null; then
|
if ! maintenance_enabled > /dev/null; then
|
||||||
@@ -156,7 +141,7 @@ upgrade_jscontroller() {
|
|||||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
echo 'Container will be stopped or restarted in 5 seconds...'
|
||||||
sleep 5
|
sleep 5
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
|
# stop iobroker and wait until all processes stopped or pkill_timeout is reached
|
||||||
@@ -164,29 +149,37 @@ stop_iob() {
|
|||||||
local status timeout
|
local status timeout
|
||||||
|
|
||||||
timeout="$(date --date="now + $pkill_timeout sec" +%s)"
|
timeout="$(date --date="now + $pkill_timeout sec" +%s)"
|
||||||
pkill -u iobroker -f iobroker.js-controller
|
pkill -u iobroker -f 'iobroker.js-controller[^/]*$'
|
||||||
status=$?
|
status=$?
|
||||||
if (( status >= 2 )); then # syntax error or fatal error
|
if (( status >= 2 )); then # syntax error or fatal error
|
||||||
|
echo 'fatal error' #for logging
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if (( status == 1 )); then # no processes matched
|
if (( status == 1 )); then # no processes matched
|
||||||
|
echo 'no process matched' #for logging
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# pgrep exits with status 1 when there are no matches
|
if [[ "$killbyname" != yes ]]; then
|
||||||
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
|
# pgrep exits with status 1 when there are no matches
|
||||||
if (($(date +%s) > timeout)); then
|
while pgrep -u iobroker > /dev/null; (( $? != 1 )); do
|
||||||
echo -e '\nTimeout reached. Killing remaining processes...'
|
if (($(date +%s) > timeout)); then
|
||||||
pgrep --list-full -u iobroker
|
echo -e '\nTimeout reached. Killing remaining processes...'
|
||||||
pkill --signal SIGKILL -u iobroker
|
pgrep --list-full -u iobroker
|
||||||
echo 'Done.'
|
pkill --signal SIGKILL -u iobroker
|
||||||
return
|
echo 'Done.'
|
||||||
fi
|
return
|
||||||
|
fi
|
||||||
echo -n '.'
|
echo -n '.'
|
||||||
sleep 1
|
sleep 1
|
||||||
done
|
done
|
||||||
|
else
|
||||||
|
for ((i=0; i<3; i++)); do
|
||||||
|
sleep 1
|
||||||
|
echo -n '.'
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
echo -e '\nDone.'
|
echo -e '\nDone.'
|
||||||
}
|
}
|
||||||
@@ -205,22 +198,24 @@ restart_container() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n 'Stopping ioBroker...'
|
if ! maintenance_enabled > /dev/null; then
|
||||||
stop_iob
|
echo -n 'Stopping ioBroker...'
|
||||||
|
stop_iob
|
||||||
|
fi
|
||||||
|
|
||||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
echo 'Container will be stopped or restarted in 5 seconds...'
|
||||||
sleep 5
|
sleep 5
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# restore iobroker
|
# restore iobroker
|
||||||
restore_iobroker() {
|
restore_iobroker() {
|
||||||
echo 'You are now going to perform a restore of your iobroker.'
|
echo 'You are now going to perform a restore of your iobroker.'
|
||||||
|
echo 'During the restore process, the container will automatically switch into maintenance mode and stop ioBroker.'
|
||||||
|
echo 'Depending on the restart policy, your container will be stopped or restarted automatically after the restore.'
|
||||||
|
|
||||||
if [[ "$autoconfirm" != yes ]]; then
|
if [[ "$autoconfirm" != yes ]]; then
|
||||||
local reply
|
local reply
|
||||||
@@ -231,15 +226,19 @@ restore_iobroker() {
|
|||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
echo 'This command was already confirmed by the -y or --yes option.'
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo -n 'Stopping ioBroker...'
|
if check_starting > /dev/null; then
|
||||||
stop_iob
|
echo "Startup script is still running."
|
||||||
|
echo "Please check container log and wait until ioBroker is sucessfully started."
|
||||||
|
echo "Then try again."
|
||||||
|
return 1
|
||||||
|
fi
|
||||||
|
|
||||||
# fixing permission errors during restore
|
if ! maintenance_enabled > /dev/null; then
|
||||||
#chown -R $setuid:$setgid /opt/iobroker/backup
|
autoconfirm=yes
|
||||||
|
enable_maintenance
|
||||||
|
fi
|
||||||
|
|
||||||
echo -n "Restoring ioBroker... "
|
echo -n "Restoring ioBroker... "
|
||||||
set +e
|
set +e
|
||||||
@@ -263,10 +262,10 @@ restore_iobroker() {
|
|||||||
echo "!!!! You can view installation process by taking a look at ioBroker log. !!!!"
|
echo "!!!! You can view installation process by taking a look at ioBroker log. !!!!"
|
||||||
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
|
||||||
sleep 10
|
sleep 10
|
||||||
echo 'Container will be stopped or restarted in 5 seconds...'
|
echo 'Container will be stopped or restarted in 10 seconds...'
|
||||||
sleep 5
|
sleep 10
|
||||||
echo 'stopping' > "$healthcheck"
|
echo 'stopping' > "$healthcheck"
|
||||||
pkill -u root
|
gosu root pkill -u root
|
||||||
}
|
}
|
||||||
|
|
||||||
# parsing commands and options
|
# parsing commands and options
|
||||||
|
|||||||
83
debian/scripts/setup_packages.sh
vendored
83
debian/scripts/setup_packages.sh
vendored
@@ -1,36 +1,69 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# bash strict mode
|
||||||
|
set -euo pipefail
|
||||||
|
|
||||||
|
# Reading ENV
|
||||||
|
set +u
|
||||||
|
packages=$PACKAGES
|
||||||
|
debug=$DEBUG
|
||||||
|
set -u
|
||||||
|
|
||||||
export DEBIAN_FRONTEND=noninteractive
|
export DEBIAN_FRONTEND=noninteractive
|
||||||
|
|
||||||
if [ "$1" == "-install" ]
|
check_package_preq() {
|
||||||
then
|
# check for influx packages
|
||||||
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
if [[ "$i" == "influxdb" || "$i" == "influxdb2-cli" ]]; then
|
||||||
packages=$(cat /opt/scripts/.docker_config/.packages)
|
# add influxdata repo keys
|
||||||
echo ' '
|
wget -qO- https://repos.influxdata.com/influxdata-archive_compat.key | gpg --dearmor | sudo tee /etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg > /dev/null
|
||||||
for i in $packages; do
|
echo 'deb [signed-by=/etc/apt/trusted.gpg.d/influxdata-archive_compat.gpg] https://repos.influxdata.com/debian stable main' | sudo tee /etc/apt/sources.list.d/influxdata.list
|
||||||
if [ "$(dpkg-query -W -f='${Status}' "$i" 2>/dev/null | grep -c "ok installed")" -eq 0 ];
|
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
||||||
then
|
fi
|
||||||
echo -n "$i is not installed. Installing... "
|
}
|
||||||
DEBIAN_FRONTEND=noninteractive apt-get -q -y install "$i" >> /opt/scripts/setup_packages.log 2>&1
|
check_package_validity() {
|
||||||
return=$?
|
# check string for double spaces
|
||||||
if [[ "$return" -ne 0 ]]; then
|
while echo "$packages" | grep -q ' '; do
|
||||||
echo "Failed."
|
packages=$(echo "$packages" | sed 's/ / /g')
|
||||||
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
|
||||||
echo ' '
|
|
||||||
else
|
|
||||||
echo "Done."
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
echo "$i is already installed."
|
|
||||||
fi
|
|
||||||
done
|
done
|
||||||
elif [ "$1" == "-update" ]; then
|
# remove packages when "influxdb" AND "influxdb2-cli"
|
||||||
|
if echo "$packages" | grep -qw "influxdb" && echo "$packages" | grep -qw "influxdb2-cli"; then
|
||||||
|
echo "PACKAGES includes influxdb AND influxdb2-cli."
|
||||||
|
echo "As installing both packages together is not possible, they will be skipped."
|
||||||
|
packages=$(echo "$packages" | sed 's/influxdb2-cli//g;s/influxdb//g')
|
||||||
|
# check string for double spaces again
|
||||||
|
while echo "$packages" | grep -q ' '; do
|
||||||
|
packages=$(echo "$packages" | sed 's/ / /g')
|
||||||
|
done
|
||||||
|
if [[ $debug == "true" ]]; then echo "[DEBUG] New list of packages: ""$packages"; fi
|
||||||
|
echo ' '
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
if [[ "$1" == "-install" ]]; then
|
||||||
|
echo ' '
|
||||||
|
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
||||||
|
check_package_validity
|
||||||
|
for i in $packages; do
|
||||||
|
if ! dpkg -s "$i" >/dev/null 2>&1; then
|
||||||
|
echo -n "$i is not installed. Installing... "
|
||||||
|
check_package_preq >> /opt/scripts/setup_packages.log 2>&1
|
||||||
|
if ! apt-get -q -y install "$i" >> /opt/scripts/setup_packages.log 2>&1; then
|
||||||
|
echo "Failed."
|
||||||
|
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
||||||
|
else
|
||||||
|
echo "Done."
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
echo "$i is already installed."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
elif [[ "$1" == "-update" ]]; then
|
||||||
echo -n "Updating Linux packages on first run... "
|
echo -n "Updating Linux packages on first run... "
|
||||||
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
apt-get -q update >> /opt/scripts/setup_packages.log 2>&1
|
||||||
return=$?
|
|
||||||
apt-get -q -y upgrade >> /opt/scripts/setup_packages.log 2>&1
|
|
||||||
return1=$?
|
return1=$?
|
||||||
if [[ "$return" -ne 0 || "$return1" -ne 0 ]]; then
|
apt-get -q -y upgrade >> /opt/scripts/setup_packages.log 2>&1
|
||||||
|
return2=$?
|
||||||
|
if [[ "$return1" -ne 0 || "$return2" -ne 0 ]]; then
|
||||||
echo "Failed."
|
echo "Failed."
|
||||||
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
echo "For more details see \"/opt/scripts/setup_packages.log\"."
|
||||||
echo "Make sure the container has internet access to get the latest package updates."
|
echo "Make sure the container has internet access to get the latest package updates."
|
||||||
|
|||||||
Reference in New Issue
Block a user