diff --git a/.github/workflows/build-debian-image-beta-node20.yml b/.github/workflows/build-debian-image-beta-node20.yml index b2368d4..8ad01b4 100644 --- a/.github/workflows/build-debian-image-beta-node20.yml +++ b/.github/workflows/build-debian-image-beta-node20.yml @@ -64,12 +64,17 @@ jobs: context: ./debian file: ./debian/node20/Dockerfile push: true - platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 + platforms: | + linux/amd64 + linux/arm/v7 + linux/arm64/v8 tags: | buanet/iobroker:beta-node20, buanet/iobroker:${{ env.version }}-node20, ghcr.io/buanet/iobroker:beta-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 uses: actions/github-script@v6 diff --git a/.github/workflows/build-debian-image-dev-node20.yml b/.github/workflows/build-debian-image-dev-node20.yml index 73dea66..ae8e389 100644 --- a/.github/workflows/build-debian-image-dev-node20.yml +++ b/.github/workflows/build-debian-image-dev-node20.yml @@ -9,11 +9,11 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout repo - uses: actions/checkout@v3 + uses: actions/checkout@v3.5.0 with: repository: 'buanet/ioBroker.docker' - - name: Fetching version tag and date + - name: Fetch version tag and date id: version run: | VERSION="$(cat .VERSION)" @@ -52,19 +52,24 @@ jobs: username: ${{ secrets.PACKAGES_USER }} password: ${{ secrets.PACKAGES_PASS }} - - name: Build Docker image (node20) + - name: Build and push Docker image (node20) uses: docker/build-push-action@v4.0.0 with: context: ./debian file: ./debian/node20/Dockerfile push: true - platforms: linux/amd64,linux/arm/v7,linux/arm64/v8 + platforms: | + linux/amd64 + linux/arm/v7 + linux/arm64/v8 tags: | 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 - uses: actions/github-script@v6 + - name: Delete untagged images from GitHub Container Registry + uses: actions/github-script@v6.4.1 with: github-token: ${{ secrets.PACKAGES_PASS }} script: | @@ -81,4 +86,4 @@ jobs: env: OWNER: buanet PACKAGE_NAME: iobroker - PER_PAGE: 100 + PER_PAGE: 100 diff --git a/debian/node20/Dockerfile b/debian/node20/Dockerfile new file mode 100644 index 0000000..08c0f1a --- /dev/null +++ b/debian/node20/Dockerfile @@ -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 " \ + 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"]