From d2742bf9f0c3f5e7c0bb5710579e4c4ae3afe684 Mon Sep 17 00:00:00 2001 From: Wouter Born Date: Wed, 5 Dec 2018 22:06:33 +0100 Subject: [PATCH] Use multi architecture image manifests Additionaly several new tags have been added to multi-architecture images. The complete list of tags is now: openhab/openhab: openhab/openhab:- openhab/openhab:-- openhab/openhab:latest openhab/openhab:latest- openhab/openhab:milestone openhab/openhab:milestone- openhab/openhab:snapshot openhab/openhab:snapshot- Signed-off-by: Wouter Born --- .travis.yml | 87 ++++------ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 {2.0.0/amd64 => 1.8.3}/alpine/entrypoint.sh | 0 1.8.3/alpine/manifest.yml | 18 +++ 1.8.3/amd64/alpine/entrypoint.sh | 124 -------------- 1.8.3/arm64/alpine/entrypoint.sh | 124 -------------- 1.8.3/armhf/alpine/entrypoint.sh | 124 -------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- 1.8.3/{amd64 => }/debian/entrypoint.sh | 0 1.8.3/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 2.0.0/{arm64 => }/alpine/entrypoint.sh | 0 2.0.0/alpine/manifest.yml | 18 +++ .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- {1.8.3/arm64 => 2.0.0}/debian/entrypoint.sh | 0 2.0.0/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 {2.0.0/armhf => 2.1.0}/alpine/entrypoint.sh | 0 2.1.0/alpine/manifest.yml | 18 +++ .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- {1.8.3/armhf => 2.1.0}/debian/entrypoint.sh | 0 2.1.0/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 {2.1.0/amd64 => 2.2.0}/alpine/entrypoint.sh | 0 2.2.0/alpine/manifest.yml | 18 +++ 2.2.0/amd64/debian/entrypoint.sh | 143 ---------------- 2.2.0/arm64/debian/entrypoint.sh | 143 ---------------- 2.2.0/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- {2.0.0/amd64 => 2.2.0}/debian/entrypoint.sh | 0 2.2.0/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 {2.1.0/arm64 => 2.3.0}/alpine/entrypoint.sh | 0 2.3.0/alpine/manifest.yml | 18 +++ 2.3.0/amd64/alpine/entrypoint.sh | 132 --------------- 2.3.0/amd64/debian/entrypoint.sh | 143 ---------------- 2.3.0/arm64/alpine/entrypoint.sh | 132 --------------- 2.3.0/arm64/debian/entrypoint.sh | 143 ---------------- 2.3.0/armhf/alpine/entrypoint.sh | 132 --------------- 2.3.0/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- {2.0.0/arm64 => 2.3.0}/debian/entrypoint.sh | 0 2.3.0/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 .../alpine/entrypoint.sh | 0 2.4.0-snapshot/alpine/manifest.yml | 18 +++ 2.4.0-snapshot/amd64/alpine/entrypoint.sh | 132 --------------- 2.4.0-snapshot/amd64/debian/entrypoint.sh | 143 ---------------- 2.4.0-snapshot/arm64/alpine/entrypoint.sh | 132 --------------- 2.4.0-snapshot/arm64/debian/entrypoint.sh | 143 ---------------- 2.4.0-snapshot/armhf/alpine/entrypoint.sh | 132 --------------- 2.4.0-snapshot/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- .../debian/entrypoint.sh | 0 2.4.0-snapshot/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 .../amd64 => 2.4.0.M5}/alpine/entrypoint.sh | 0 2.4.0.M5/alpine/manifest.yml | 18 +++ 2.4.0.M5/amd64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M5/amd64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M5/arm64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M5/arm64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M5/armhf/alpine/entrypoint.sh | 132 --------------- 2.4.0.M5/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- .../amd64 => 2.4.0.M5}/debian/entrypoint.sh | 0 2.4.0.M5/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 .../arm64 => 2.4.0.M6}/alpine/entrypoint.sh | 0 2.4.0.M6/alpine/manifest.yml | 18 +++ 2.4.0.M6/amd64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M6/amd64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M6/arm64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M6/arm64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M6/armhf/alpine/entrypoint.sh | 132 --------------- 2.4.0.M6/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- .../arm64 => 2.4.0.M6}/debian/entrypoint.sh | 0 2.4.0.M6/debian/manifest.yml | 18 +++ .../Dockerfile => alpine/Dockerfile-amd64} | 0 .../Dockerfile => alpine/Dockerfile-arm64} | 0 .../Dockerfile => alpine/Dockerfile-armhf} | 0 .../armhf => 2.4.0.M7}/alpine/entrypoint.sh | 0 2.4.0.M7/alpine/manifest.yml | 18 +++ 2.4.0.M7/amd64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M7/amd64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M7/arm64/alpine/entrypoint.sh | 132 --------------- 2.4.0.M7/arm64/debian/entrypoint.sh | 143 ---------------- 2.4.0.M7/armhf/alpine/entrypoint.sh | 132 --------------- 2.4.0.M7/armhf/debian/entrypoint.sh | 143 ---------------- .../Dockerfile => debian/Dockerfile-amd64} | 2 +- .../Dockerfile => debian/Dockerfile-arm64} | 2 +- .../Dockerfile => debian/Dockerfile-armhf} | 2 +- .../armhf => 2.4.0.M7}/debian/entrypoint.sh | 0 2.4.0.M7/debian/manifest.yml | 18 +++ README.md | 78 +++++---- update-img.sh => install-img.sh | 0 install-manifest-tool.sh | 12 ++ update-docker-files.sh | 153 ++++++++++++------ update-functions.sh | 5 + update-readme.sh | 2 +- update-travis-config.sh | 22 +-- 134 files changed, 566 insertions(+), 5097 deletions(-) rename 1.8.3/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 1.8.3/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 1.8.3/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.0.0/amd64 => 1.8.3}/alpine/entrypoint.sh (100%) create mode 100644 1.8.3/alpine/manifest.yml delete mode 100755 1.8.3/amd64/alpine/entrypoint.sh delete mode 100755 1.8.3/arm64/alpine/entrypoint.sh delete mode 100755 1.8.3/armhf/alpine/entrypoint.sh rename 1.8.3/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 1.8.3/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 1.8.3/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename 1.8.3/{amd64 => }/debian/entrypoint.sh (100%) create mode 100644 1.8.3/debian/manifest.yml rename 2.0.0/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.0.0/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.0.0/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename 2.0.0/{arm64 => }/alpine/entrypoint.sh (100%) create mode 100644 2.0.0/alpine/manifest.yml rename 2.0.0/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.0.0/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.0.0/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {1.8.3/arm64 => 2.0.0}/debian/entrypoint.sh (100%) create mode 100644 2.0.0/debian/manifest.yml rename 2.1.0/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.1.0/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.1.0/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.0.0/armhf => 2.1.0}/alpine/entrypoint.sh (100%) create mode 100644 2.1.0/alpine/manifest.yml rename 2.1.0/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.1.0/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.1.0/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {1.8.3/armhf => 2.1.0}/debian/entrypoint.sh (100%) create mode 100644 2.1.0/debian/manifest.yml rename 2.2.0/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.2.0/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.2.0/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.1.0/amd64 => 2.2.0}/alpine/entrypoint.sh (100%) create mode 100644 2.2.0/alpine/manifest.yml delete mode 100755 2.2.0/amd64/debian/entrypoint.sh delete mode 100755 2.2.0/arm64/debian/entrypoint.sh delete mode 100755 2.2.0/armhf/debian/entrypoint.sh rename 2.2.0/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.2.0/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.2.0/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.0.0/amd64 => 2.2.0}/debian/entrypoint.sh (100%) create mode 100644 2.2.0/debian/manifest.yml rename 2.3.0/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.3.0/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.3.0/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.1.0/arm64 => 2.3.0}/alpine/entrypoint.sh (100%) create mode 100644 2.3.0/alpine/manifest.yml delete mode 100755 2.3.0/amd64/alpine/entrypoint.sh delete mode 100755 2.3.0/amd64/debian/entrypoint.sh delete mode 100755 2.3.0/arm64/alpine/entrypoint.sh delete mode 100755 2.3.0/arm64/debian/entrypoint.sh delete mode 100755 2.3.0/armhf/alpine/entrypoint.sh delete mode 100755 2.3.0/armhf/debian/entrypoint.sh rename 2.3.0/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.3.0/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.3.0/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.0.0/arm64 => 2.3.0}/debian/entrypoint.sh (100%) create mode 100644 2.3.0/debian/manifest.yml rename 2.4.0-snapshot/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.4.0-snapshot/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.4.0-snapshot/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.1.0/armhf => 2.4.0-snapshot}/alpine/entrypoint.sh (100%) create mode 100644 2.4.0-snapshot/alpine/manifest.yml delete mode 100755 2.4.0-snapshot/amd64/alpine/entrypoint.sh delete mode 100755 2.4.0-snapshot/amd64/debian/entrypoint.sh delete mode 100755 2.4.0-snapshot/arm64/alpine/entrypoint.sh delete mode 100755 2.4.0-snapshot/arm64/debian/entrypoint.sh delete mode 100755 2.4.0-snapshot/armhf/alpine/entrypoint.sh delete mode 100755 2.4.0-snapshot/armhf/debian/entrypoint.sh rename 2.4.0-snapshot/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.4.0-snapshot/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.4.0-snapshot/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.0.0/armhf => 2.4.0-snapshot}/debian/entrypoint.sh (100%) create mode 100644 2.4.0-snapshot/debian/manifest.yml rename 2.4.0.M5/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.4.0.M5/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.4.0.M5/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.2.0/amd64 => 2.4.0.M5}/alpine/entrypoint.sh (100%) create mode 100644 2.4.0.M5/alpine/manifest.yml delete mode 100755 2.4.0.M5/amd64/alpine/entrypoint.sh delete mode 100755 2.4.0.M5/amd64/debian/entrypoint.sh delete mode 100755 2.4.0.M5/arm64/alpine/entrypoint.sh delete mode 100755 2.4.0.M5/arm64/debian/entrypoint.sh delete mode 100755 2.4.0.M5/armhf/alpine/entrypoint.sh delete mode 100755 2.4.0.M5/armhf/debian/entrypoint.sh rename 2.4.0.M5/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.4.0.M5/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.4.0.M5/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.1.0/amd64 => 2.4.0.M5}/debian/entrypoint.sh (100%) create mode 100644 2.4.0.M5/debian/manifest.yml rename 2.4.0.M6/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.4.0.M6/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.4.0.M6/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.2.0/arm64 => 2.4.0.M6}/alpine/entrypoint.sh (100%) create mode 100644 2.4.0.M6/alpine/manifest.yml delete mode 100755 2.4.0.M6/amd64/alpine/entrypoint.sh delete mode 100755 2.4.0.M6/amd64/debian/entrypoint.sh delete mode 100755 2.4.0.M6/arm64/alpine/entrypoint.sh delete mode 100755 2.4.0.M6/arm64/debian/entrypoint.sh delete mode 100755 2.4.0.M6/armhf/alpine/entrypoint.sh delete mode 100755 2.4.0.M6/armhf/debian/entrypoint.sh rename 2.4.0.M6/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.4.0.M6/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.4.0.M6/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.1.0/arm64 => 2.4.0.M6}/debian/entrypoint.sh (100%) create mode 100644 2.4.0.M6/debian/manifest.yml rename 2.4.0.M7/{amd64/alpine/Dockerfile => alpine/Dockerfile-amd64} (100%) rename 2.4.0.M7/{arm64/alpine/Dockerfile => alpine/Dockerfile-arm64} (100%) rename 2.4.0.M7/{armhf/alpine/Dockerfile => alpine/Dockerfile-armhf} (100%) rename {2.2.0/armhf => 2.4.0.M7}/alpine/entrypoint.sh (100%) create mode 100644 2.4.0.M7/alpine/manifest.yml delete mode 100755 2.4.0.M7/amd64/alpine/entrypoint.sh delete mode 100755 2.4.0.M7/amd64/debian/entrypoint.sh delete mode 100755 2.4.0.M7/arm64/alpine/entrypoint.sh delete mode 100755 2.4.0.M7/arm64/debian/entrypoint.sh delete mode 100755 2.4.0.M7/armhf/alpine/entrypoint.sh delete mode 100755 2.4.0.M7/armhf/debian/entrypoint.sh rename 2.4.0.M7/{amd64/debian/Dockerfile => debian/Dockerfile-amd64} (98%) rename 2.4.0.M7/{arm64/debian/Dockerfile => debian/Dockerfile-arm64} (98%) rename 2.4.0.M7/{armhf/debian/Dockerfile => debian/Dockerfile-armhf} (98%) rename {2.1.0/armhf => 2.4.0.M7}/debian/entrypoint.sh (100%) create mode 100644 2.4.0.M7/debian/manifest.yml rename update-img.sh => install-img.sh (100%) create mode 100755 install-manifest-tool.sh diff --git a/.travis.yml b/.travis.yml index 4b8d7213..57cac923 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,70 +15,41 @@ services: before_install: - sudo apt-get install -y uidmap - ./update-docker-files.sh - - ./update-img.sh + - ./install-img.sh + - ./install-manifest-tool.sh - docker info - docker run --rm --privileged multiarch/qemu-user-static:register --reset + - ARCHES="amd64 armhf arm64" install: - - docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") --build-arg VERSION=$VERSION -t $DOCKER_REPO:$VERSION-$TARGET-$DIST $VERSION/$TARGET/$DIST - - docker run --rm $DOCKER_REPO:$VERSION-$TARGET-$DIST uname -a + - for ARCH in $ARCHES; do + docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") --build-arg VERSION=$VERSION -f $VERSION/$DIST/Dockerfile-$ARCH -t $DOCKER_REPO:$VERSION-$ARCH-$DIST $VERSION/$DIST; + docker run --rm $DOCKER_REPO:$VERSION-$ARCH-$DIST uname -a; + done after_success: - docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD - - docker push $DOCKER_REPO:$VERSION-$TARGET-$DIST + - for ARCH in $ARCHES; do + docker push $DOCKER_REPO:$VERSION-$ARCH-$DIST; + done + - manifest-tool push from-spec $VERSION/$DIST/manifest.yml matrix: fast_finish: true env: matrix: - - VERSION=1.8.3 DIST=alpine TARGET=amd64 - - VERSION=1.8.3 DIST=alpine TARGET=arm64 - - VERSION=1.8.3 DIST=alpine TARGET=armhf - - VERSION=1.8.3 DIST=debian TARGET=amd64 - - VERSION=1.8.3 DIST=debian TARGET=arm64 - - VERSION=1.8.3 DIST=debian TARGET=armhf - - VERSION=2.0.0 DIST=alpine TARGET=amd64 - - VERSION=2.0.0 DIST=alpine TARGET=arm64 - - VERSION=2.0.0 DIST=alpine TARGET=armhf - - VERSION=2.0.0 DIST=debian TARGET=amd64 - - VERSION=2.0.0 DIST=debian TARGET=arm64 - - VERSION=2.0.0 DIST=debian TARGET=armhf - - VERSION=2.1.0 DIST=alpine TARGET=amd64 - - VERSION=2.1.0 DIST=alpine TARGET=arm64 - - VERSION=2.1.0 DIST=alpine TARGET=armhf - - VERSION=2.1.0 DIST=debian TARGET=amd64 - - VERSION=2.1.0 DIST=debian TARGET=arm64 - - VERSION=2.1.0 DIST=debian TARGET=armhf - - VERSION=2.2.0 DIST=alpine TARGET=amd64 - - VERSION=2.2.0 DIST=alpine TARGET=arm64 - - VERSION=2.2.0 DIST=alpine TARGET=armhf - - VERSION=2.2.0 DIST=debian TARGET=amd64 - - VERSION=2.2.0 DIST=debian TARGET=arm64 - - VERSION=2.2.0 DIST=debian TARGET=armhf - - VERSION=2.3.0 DIST=alpine TARGET=amd64 - - VERSION=2.3.0 DIST=alpine TARGET=arm64 - - VERSION=2.3.0 DIST=alpine TARGET=armhf - - VERSION=2.3.0 DIST=debian TARGET=amd64 - - VERSION=2.3.0 DIST=debian TARGET=arm64 - - VERSION=2.3.0 DIST=debian TARGET=armhf - - VERSION=2.4.0.M5 DIST=alpine TARGET=amd64 - - VERSION=2.4.0.M5 DIST=alpine TARGET=arm64 - - VERSION=2.4.0.M5 DIST=alpine TARGET=armhf - - VERSION=2.4.0.M5 DIST=debian TARGET=amd64 - - VERSION=2.4.0.M5 DIST=debian TARGET=arm64 - - VERSION=2.4.0.M5 DIST=debian TARGET=armhf - - VERSION=2.4.0.M6 DIST=alpine TARGET=amd64 - - VERSION=2.4.0.M6 DIST=alpine TARGET=arm64 - - VERSION=2.4.0.M6 DIST=alpine TARGET=armhf - - VERSION=2.4.0.M6 DIST=debian TARGET=amd64 - - VERSION=2.4.0.M6 DIST=debian TARGET=arm64 - - VERSION=2.4.0.M6 DIST=debian TARGET=armhf - - VERSION=2.4.0.M7 DIST=alpine TARGET=amd64 - - VERSION=2.4.0.M7 DIST=alpine TARGET=arm64 - - VERSION=2.4.0.M7 DIST=alpine TARGET=armhf - - VERSION=2.4.0.M7 DIST=debian TARGET=amd64 - - VERSION=2.4.0.M7 DIST=debian TARGET=arm64 - - VERSION=2.4.0.M7 DIST=debian TARGET=armhf - - VERSION=2.4.0-snapshot DIST=alpine TARGET=amd64 - - VERSION=2.4.0-snapshot DIST=alpine TARGET=arm64 - - VERSION=2.4.0-snapshot DIST=alpine TARGET=armhf - - VERSION=2.4.0-snapshot DIST=debian TARGET=amd64 - - VERSION=2.4.0-snapshot DIST=debian TARGET=arm64 - - VERSION=2.4.0-snapshot DIST=debian TARGET=armhf + - VERSION=1.8.3 DIST=alpine + - VERSION=1.8.3 DIST=debian + - VERSION=2.0.0 DIST=alpine + - VERSION=2.0.0 DIST=debian + - VERSION=2.1.0 DIST=alpine + - VERSION=2.1.0 DIST=debian + - VERSION=2.2.0 DIST=alpine + - VERSION=2.2.0 DIST=debian + - VERSION=2.3.0 DIST=alpine + - VERSION=2.3.0 DIST=debian + - VERSION=2.4.0.M5 DIST=alpine + - VERSION=2.4.0.M5 DIST=debian + - VERSION=2.4.0.M6 DIST=alpine + - VERSION=2.4.0.M6 DIST=debian + - VERSION=2.4.0.M7 DIST=alpine + - VERSION=2.4.0.M7 DIST=debian + - VERSION=2.4.0-snapshot DIST=alpine + - VERSION=2.4.0-snapshot DIST=debian diff --git a/1.8.3/amd64/alpine/Dockerfile b/1.8.3/alpine/Dockerfile-amd64 similarity index 100% rename from 1.8.3/amd64/alpine/Dockerfile rename to 1.8.3/alpine/Dockerfile-amd64 diff --git a/1.8.3/arm64/alpine/Dockerfile b/1.8.3/alpine/Dockerfile-arm64 similarity index 100% rename from 1.8.3/arm64/alpine/Dockerfile rename to 1.8.3/alpine/Dockerfile-arm64 diff --git a/1.8.3/armhf/alpine/Dockerfile b/1.8.3/alpine/Dockerfile-armhf similarity index 100% rename from 1.8.3/armhf/alpine/Dockerfile rename to 1.8.3/alpine/Dockerfile-armhf diff --git a/2.0.0/amd64/alpine/entrypoint.sh b/1.8.3/alpine/entrypoint.sh similarity index 100% rename from 2.0.0/amd64/alpine/entrypoint.sh rename to 1.8.3/alpine/entrypoint.sh diff --git a/1.8.3/alpine/manifest.yml b/1.8.3/alpine/manifest.yml new file mode 100644 index 00000000..722864ba --- /dev/null +++ b/1.8.3/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:1.8.3-alpine +tags: [] +manifests: + - + image: openhab/openhab:1.8.3-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:1.8.3-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:1.8.3-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/1.8.3/amd64/alpine/entrypoint.sh b/1.8.3/amd64/alpine/entrypoint.sh deleted file mode 100755 index eb64e1f1..00000000 --- a/1.8.3/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/1.8.3/arm64/alpine/entrypoint.sh b/1.8.3/arm64/alpine/entrypoint.sh deleted file mode 100755 index eb64e1f1..00000000 --- a/1.8.3/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/1.8.3/armhf/alpine/entrypoint.sh b/1.8.3/armhf/alpine/entrypoint.sh deleted file mode 100755 index eb64e1f1..00000000 --- a/1.8.3/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,124 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/1.8.3/amd64/debian/Dockerfile b/1.8.3/debian/Dockerfile-amd64 similarity index 98% rename from 1.8.3/amd64/debian/Dockerfile rename to 1.8.3/debian/Dockerfile-amd64 index d6071b9d..4343fae7 100644 --- a/1.8.3/amd64/debian/Dockerfile +++ b/1.8.3/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/1.8.3/arm64/debian/Dockerfile b/1.8.3/debian/Dockerfile-arm64 similarity index 98% rename from 1.8.3/arm64/debian/Dockerfile rename to 1.8.3/debian/Dockerfile-arm64 index 73a2bb3c..2d624176 100644 --- a/1.8.3/arm64/debian/Dockerfile +++ b/1.8.3/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/1.8.3/armhf/debian/Dockerfile b/1.8.3/debian/Dockerfile-armhf similarity index 98% rename from 1.8.3/armhf/debian/Dockerfile rename to 1.8.3/debian/Dockerfile-armhf index e4e9997d..c065c231 100644 --- a/1.8.3/armhf/debian/Dockerfile +++ b/1.8.3/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/1.8.3/amd64/debian/entrypoint.sh b/1.8.3/debian/entrypoint.sh similarity index 100% rename from 1.8.3/amd64/debian/entrypoint.sh rename to 1.8.3/debian/entrypoint.sh diff --git a/1.8.3/debian/manifest.yml b/1.8.3/debian/manifest.yml new file mode 100644 index 00000000..8cb79aa2 --- /dev/null +++ b/1.8.3/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:1.8.3-debian +tags: ['1.8.3'] +manifests: + - + image: openhab/openhab:1.8.3-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:1.8.3-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:1.8.3-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.0.0/amd64/alpine/Dockerfile b/2.0.0/alpine/Dockerfile-amd64 similarity index 100% rename from 2.0.0/amd64/alpine/Dockerfile rename to 2.0.0/alpine/Dockerfile-amd64 diff --git a/2.0.0/arm64/alpine/Dockerfile b/2.0.0/alpine/Dockerfile-arm64 similarity index 100% rename from 2.0.0/arm64/alpine/Dockerfile rename to 2.0.0/alpine/Dockerfile-arm64 diff --git a/2.0.0/armhf/alpine/Dockerfile b/2.0.0/alpine/Dockerfile-armhf similarity index 100% rename from 2.0.0/armhf/alpine/Dockerfile rename to 2.0.0/alpine/Dockerfile-armhf diff --git a/2.0.0/arm64/alpine/entrypoint.sh b/2.0.0/alpine/entrypoint.sh similarity index 100% rename from 2.0.0/arm64/alpine/entrypoint.sh rename to 2.0.0/alpine/entrypoint.sh diff --git a/2.0.0/alpine/manifest.yml b/2.0.0/alpine/manifest.yml new file mode 100644 index 00000000..12b4ef1e --- /dev/null +++ b/2.0.0/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.0.0-alpine +tags: [] +manifests: + - + image: openhab/openhab:2.0.0-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.0.0-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.0.0-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.0.0/amd64/debian/Dockerfile b/2.0.0/debian/Dockerfile-amd64 similarity index 98% rename from 2.0.0/amd64/debian/Dockerfile rename to 2.0.0/debian/Dockerfile-amd64 index 486f4080..6b3347c6 100644 --- a/2.0.0/amd64/debian/Dockerfile +++ b/2.0.0/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.0.0/arm64/debian/Dockerfile b/2.0.0/debian/Dockerfile-arm64 similarity index 98% rename from 2.0.0/arm64/debian/Dockerfile rename to 2.0.0/debian/Dockerfile-arm64 index 6a4bd31a..8a72c3a0 100644 --- a/2.0.0/arm64/debian/Dockerfile +++ b/2.0.0/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.0.0/armhf/debian/Dockerfile b/2.0.0/debian/Dockerfile-armhf similarity index 98% rename from 2.0.0/armhf/debian/Dockerfile rename to 2.0.0/debian/Dockerfile-armhf index 663b2ec8..3cf80b4a 100644 --- a/2.0.0/armhf/debian/Dockerfile +++ b/2.0.0/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/1.8.3/arm64/debian/entrypoint.sh b/2.0.0/debian/entrypoint.sh similarity index 100% rename from 1.8.3/arm64/debian/entrypoint.sh rename to 2.0.0/debian/entrypoint.sh diff --git a/2.0.0/debian/manifest.yml b/2.0.0/debian/manifest.yml new file mode 100644 index 00000000..90d23753 --- /dev/null +++ b/2.0.0/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.0.0-debian +tags: ['2.0.0'] +manifests: + - + image: openhab/openhab:2.0.0-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.0.0-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.0.0-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.1.0/amd64/alpine/Dockerfile b/2.1.0/alpine/Dockerfile-amd64 similarity index 100% rename from 2.1.0/amd64/alpine/Dockerfile rename to 2.1.0/alpine/Dockerfile-amd64 diff --git a/2.1.0/arm64/alpine/Dockerfile b/2.1.0/alpine/Dockerfile-arm64 similarity index 100% rename from 2.1.0/arm64/alpine/Dockerfile rename to 2.1.0/alpine/Dockerfile-arm64 diff --git a/2.1.0/armhf/alpine/Dockerfile b/2.1.0/alpine/Dockerfile-armhf similarity index 100% rename from 2.1.0/armhf/alpine/Dockerfile rename to 2.1.0/alpine/Dockerfile-armhf diff --git a/2.0.0/armhf/alpine/entrypoint.sh b/2.1.0/alpine/entrypoint.sh similarity index 100% rename from 2.0.0/armhf/alpine/entrypoint.sh rename to 2.1.0/alpine/entrypoint.sh diff --git a/2.1.0/alpine/manifest.yml b/2.1.0/alpine/manifest.yml new file mode 100644 index 00000000..0e8dad7c --- /dev/null +++ b/2.1.0/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.1.0-alpine +tags: [] +manifests: + - + image: openhab/openhab:2.1.0-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.1.0-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.1.0-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.1.0/amd64/debian/Dockerfile b/2.1.0/debian/Dockerfile-amd64 similarity index 98% rename from 2.1.0/amd64/debian/Dockerfile rename to 2.1.0/debian/Dockerfile-amd64 index e3ca2872..8fedbb7b 100644 --- a/2.1.0/amd64/debian/Dockerfile +++ b/2.1.0/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.1.0/arm64/debian/Dockerfile b/2.1.0/debian/Dockerfile-arm64 similarity index 98% rename from 2.1.0/arm64/debian/Dockerfile rename to 2.1.0/debian/Dockerfile-arm64 index 4db0c095..5b1a3ae4 100644 --- a/2.1.0/arm64/debian/Dockerfile +++ b/2.1.0/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.1.0/armhf/debian/Dockerfile b/2.1.0/debian/Dockerfile-armhf similarity index 98% rename from 2.1.0/armhf/debian/Dockerfile rename to 2.1.0/debian/Dockerfile-armhf index 11a8f91f..a9e23e4e 100644 --- a/2.1.0/armhf/debian/Dockerfile +++ b/2.1.0/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/1.8.3/armhf/debian/entrypoint.sh b/2.1.0/debian/entrypoint.sh similarity index 100% rename from 1.8.3/armhf/debian/entrypoint.sh rename to 2.1.0/debian/entrypoint.sh diff --git a/2.1.0/debian/manifest.yml b/2.1.0/debian/manifest.yml new file mode 100644 index 00000000..fe4560fd --- /dev/null +++ b/2.1.0/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.1.0-debian +tags: ['2.1.0'] +manifests: + - + image: openhab/openhab:2.1.0-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.1.0-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.1.0-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.2.0/amd64/alpine/Dockerfile b/2.2.0/alpine/Dockerfile-amd64 similarity index 100% rename from 2.2.0/amd64/alpine/Dockerfile rename to 2.2.0/alpine/Dockerfile-amd64 diff --git a/2.2.0/arm64/alpine/Dockerfile b/2.2.0/alpine/Dockerfile-arm64 similarity index 100% rename from 2.2.0/arm64/alpine/Dockerfile rename to 2.2.0/alpine/Dockerfile-arm64 diff --git a/2.2.0/armhf/alpine/Dockerfile b/2.2.0/alpine/Dockerfile-armhf similarity index 100% rename from 2.2.0/armhf/alpine/Dockerfile rename to 2.2.0/alpine/Dockerfile-armhf diff --git a/2.1.0/amd64/alpine/entrypoint.sh b/2.2.0/alpine/entrypoint.sh similarity index 100% rename from 2.1.0/amd64/alpine/entrypoint.sh rename to 2.2.0/alpine/entrypoint.sh diff --git a/2.2.0/alpine/manifest.yml b/2.2.0/alpine/manifest.yml new file mode 100644 index 00000000..ff4f8d2b --- /dev/null +++ b/2.2.0/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.2.0-alpine +tags: [] +manifests: + - + image: openhab/openhab:2.2.0-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.2.0-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.2.0-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.2.0/amd64/debian/entrypoint.sh b/2.2.0/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.2.0/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.2.0/arm64/debian/entrypoint.sh b/2.2.0/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.2.0/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.2.0/armhf/debian/entrypoint.sh b/2.2.0/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.2.0/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.2.0/amd64/debian/Dockerfile b/2.2.0/debian/Dockerfile-amd64 similarity index 98% rename from 2.2.0/amd64/debian/Dockerfile rename to 2.2.0/debian/Dockerfile-amd64 index 643acb1f..79efb9ed 100644 --- a/2.2.0/amd64/debian/Dockerfile +++ b/2.2.0/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.2.0/arm64/debian/Dockerfile b/2.2.0/debian/Dockerfile-arm64 similarity index 98% rename from 2.2.0/arm64/debian/Dockerfile rename to 2.2.0/debian/Dockerfile-arm64 index a6269437..ae162e96 100644 --- a/2.2.0/arm64/debian/Dockerfile +++ b/2.2.0/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.2.0/armhf/debian/Dockerfile b/2.2.0/debian/Dockerfile-armhf similarity index 98% rename from 2.2.0/armhf/debian/Dockerfile rename to 2.2.0/debian/Dockerfile-armhf index 82220f33..3ea1cd40 100644 --- a/2.2.0/armhf/debian/Dockerfile +++ b/2.2.0/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.0.0/amd64/debian/entrypoint.sh b/2.2.0/debian/entrypoint.sh similarity index 100% rename from 2.0.0/amd64/debian/entrypoint.sh rename to 2.2.0/debian/entrypoint.sh diff --git a/2.2.0/debian/manifest.yml b/2.2.0/debian/manifest.yml new file mode 100644 index 00000000..a2b47274 --- /dev/null +++ b/2.2.0/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.2.0-debian +tags: ['2.2.0'] +manifests: + - + image: openhab/openhab:2.2.0-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.2.0-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.2.0-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.3.0/amd64/alpine/Dockerfile b/2.3.0/alpine/Dockerfile-amd64 similarity index 100% rename from 2.3.0/amd64/alpine/Dockerfile rename to 2.3.0/alpine/Dockerfile-amd64 diff --git a/2.3.0/arm64/alpine/Dockerfile b/2.3.0/alpine/Dockerfile-arm64 similarity index 100% rename from 2.3.0/arm64/alpine/Dockerfile rename to 2.3.0/alpine/Dockerfile-arm64 diff --git a/2.3.0/armhf/alpine/Dockerfile b/2.3.0/alpine/Dockerfile-armhf similarity index 100% rename from 2.3.0/armhf/alpine/Dockerfile rename to 2.3.0/alpine/Dockerfile-armhf diff --git a/2.1.0/arm64/alpine/entrypoint.sh b/2.3.0/alpine/entrypoint.sh similarity index 100% rename from 2.1.0/arm64/alpine/entrypoint.sh rename to 2.3.0/alpine/entrypoint.sh diff --git a/2.3.0/alpine/manifest.yml b/2.3.0/alpine/manifest.yml new file mode 100644 index 00000000..161f19b0 --- /dev/null +++ b/2.3.0/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.3.0-alpine +tags: ['latest-alpine'] +manifests: + - + image: openhab/openhab:2.3.0-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.3.0-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.3.0-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.3.0/amd64/alpine/entrypoint.sh b/2.3.0/amd64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.3.0/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/amd64/debian/entrypoint.sh b/2.3.0/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.3.0/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/arm64/alpine/entrypoint.sh b/2.3.0/arm64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.3.0/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/arm64/debian/entrypoint.sh b/2.3.0/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.3.0/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/armhf/alpine/entrypoint.sh b/2.3.0/armhf/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.3.0/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/armhf/debian/entrypoint.sh b/2.3.0/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.3.0/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.3.0/amd64/debian/Dockerfile b/2.3.0/debian/Dockerfile-amd64 similarity index 98% rename from 2.3.0/amd64/debian/Dockerfile rename to 2.3.0/debian/Dockerfile-amd64 index 86a85aaf..68d927a8 100644 --- a/2.3.0/amd64/debian/Dockerfile +++ b/2.3.0/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.3.0/arm64/debian/Dockerfile b/2.3.0/debian/Dockerfile-arm64 similarity index 98% rename from 2.3.0/arm64/debian/Dockerfile rename to 2.3.0/debian/Dockerfile-arm64 index d6832af6..170f21bf 100644 --- a/2.3.0/arm64/debian/Dockerfile +++ b/2.3.0/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.3.0/armhf/debian/Dockerfile b/2.3.0/debian/Dockerfile-armhf similarity index 98% rename from 2.3.0/armhf/debian/Dockerfile rename to 2.3.0/debian/Dockerfile-armhf index 00f5e979..f252a7ad 100644 --- a/2.3.0/armhf/debian/Dockerfile +++ b/2.3.0/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.0.0/arm64/debian/entrypoint.sh b/2.3.0/debian/entrypoint.sh similarity index 100% rename from 2.0.0/arm64/debian/entrypoint.sh rename to 2.3.0/debian/entrypoint.sh diff --git a/2.3.0/debian/manifest.yml b/2.3.0/debian/manifest.yml new file mode 100644 index 00000000..dab5f84f --- /dev/null +++ b/2.3.0/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.3.0-debian +tags: ['2.3.0','latest','latest-debian'] +manifests: + - + image: openhab/openhab:2.3.0-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.3.0-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.3.0-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.4.0-snapshot/amd64/alpine/Dockerfile b/2.4.0-snapshot/alpine/Dockerfile-amd64 similarity index 100% rename from 2.4.0-snapshot/amd64/alpine/Dockerfile rename to 2.4.0-snapshot/alpine/Dockerfile-amd64 diff --git a/2.4.0-snapshot/arm64/alpine/Dockerfile b/2.4.0-snapshot/alpine/Dockerfile-arm64 similarity index 100% rename from 2.4.0-snapshot/arm64/alpine/Dockerfile rename to 2.4.0-snapshot/alpine/Dockerfile-arm64 diff --git a/2.4.0-snapshot/armhf/alpine/Dockerfile b/2.4.0-snapshot/alpine/Dockerfile-armhf similarity index 100% rename from 2.4.0-snapshot/armhf/alpine/Dockerfile rename to 2.4.0-snapshot/alpine/Dockerfile-armhf diff --git a/2.1.0/armhf/alpine/entrypoint.sh b/2.4.0-snapshot/alpine/entrypoint.sh similarity index 100% rename from 2.1.0/armhf/alpine/entrypoint.sh rename to 2.4.0-snapshot/alpine/entrypoint.sh diff --git a/2.4.0-snapshot/alpine/manifest.yml b/2.4.0-snapshot/alpine/manifest.yml new file mode 100644 index 00000000..e742a6b7 --- /dev/null +++ b/2.4.0-snapshot/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0-snapshot-alpine +tags: ['snapshot-alpine'] +manifests: + - + image: openhab/openhab:2.4.0-snapshot-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0-snapshot-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0-snapshot-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.4.0-snapshot/amd64/alpine/entrypoint.sh b/2.4.0-snapshot/amd64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0-snapshot/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/amd64/debian/entrypoint.sh b/2.4.0-snapshot/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0-snapshot/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/arm64/alpine/entrypoint.sh b/2.4.0-snapshot/arm64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0-snapshot/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/arm64/debian/entrypoint.sh b/2.4.0-snapshot/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0-snapshot/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/armhf/alpine/entrypoint.sh b/2.4.0-snapshot/armhf/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0-snapshot/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/armhf/debian/entrypoint.sh b/2.4.0-snapshot/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0-snapshot/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0-snapshot/amd64/debian/Dockerfile b/2.4.0-snapshot/debian/Dockerfile-amd64 similarity index 98% rename from 2.4.0-snapshot/amd64/debian/Dockerfile rename to 2.4.0-snapshot/debian/Dockerfile-amd64 index d371acb5..949f0ff0 100644 --- a/2.4.0-snapshot/amd64/debian/Dockerfile +++ b/2.4.0-snapshot/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0-snapshot/arm64/debian/Dockerfile b/2.4.0-snapshot/debian/Dockerfile-arm64 similarity index 98% rename from 2.4.0-snapshot/arm64/debian/Dockerfile rename to 2.4.0-snapshot/debian/Dockerfile-arm64 index b5b9591a..3db4c8e1 100644 --- a/2.4.0-snapshot/arm64/debian/Dockerfile +++ b/2.4.0-snapshot/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0-snapshot/armhf/debian/Dockerfile b/2.4.0-snapshot/debian/Dockerfile-armhf similarity index 98% rename from 2.4.0-snapshot/armhf/debian/Dockerfile rename to 2.4.0-snapshot/debian/Dockerfile-armhf index 18d52173..25dbf275 100644 --- a/2.4.0-snapshot/armhf/debian/Dockerfile +++ b/2.4.0-snapshot/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.0.0/armhf/debian/entrypoint.sh b/2.4.0-snapshot/debian/entrypoint.sh similarity index 100% rename from 2.0.0/armhf/debian/entrypoint.sh rename to 2.4.0-snapshot/debian/entrypoint.sh diff --git a/2.4.0-snapshot/debian/manifest.yml b/2.4.0-snapshot/debian/manifest.yml new file mode 100644 index 00000000..2514525d --- /dev/null +++ b/2.4.0-snapshot/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0-snapshot-debian +tags: ['2.4.0-snapshot','snapshot','snapshot-debian'] +manifests: + - + image: openhab/openhab:2.4.0-snapshot-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0-snapshot-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0-snapshot-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M5/amd64/alpine/Dockerfile b/2.4.0.M5/alpine/Dockerfile-amd64 similarity index 100% rename from 2.4.0.M5/amd64/alpine/Dockerfile rename to 2.4.0.M5/alpine/Dockerfile-amd64 diff --git a/2.4.0.M5/arm64/alpine/Dockerfile b/2.4.0.M5/alpine/Dockerfile-arm64 similarity index 100% rename from 2.4.0.M5/arm64/alpine/Dockerfile rename to 2.4.0.M5/alpine/Dockerfile-arm64 diff --git a/2.4.0.M5/armhf/alpine/Dockerfile b/2.4.0.M5/alpine/Dockerfile-armhf similarity index 100% rename from 2.4.0.M5/armhf/alpine/Dockerfile rename to 2.4.0.M5/alpine/Dockerfile-armhf diff --git a/2.2.0/amd64/alpine/entrypoint.sh b/2.4.0.M5/alpine/entrypoint.sh similarity index 100% rename from 2.2.0/amd64/alpine/entrypoint.sh rename to 2.4.0.M5/alpine/entrypoint.sh diff --git a/2.4.0.M5/alpine/manifest.yml b/2.4.0.M5/alpine/manifest.yml new file mode 100644 index 00000000..fcd5bc72 --- /dev/null +++ b/2.4.0.M5/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M5-alpine +tags: [] +manifests: + - + image: openhab/openhab:2.4.0.M5-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M5-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M5-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M5/amd64/alpine/entrypoint.sh b/2.4.0.M5/amd64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M5/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/amd64/debian/entrypoint.sh b/2.4.0.M5/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M5/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/arm64/alpine/entrypoint.sh b/2.4.0.M5/arm64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M5/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/arm64/debian/entrypoint.sh b/2.4.0.M5/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M5/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/armhf/alpine/entrypoint.sh b/2.4.0.M5/armhf/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M5/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/armhf/debian/entrypoint.sh b/2.4.0.M5/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M5/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M5/amd64/debian/Dockerfile b/2.4.0.M5/debian/Dockerfile-amd64 similarity index 98% rename from 2.4.0.M5/amd64/debian/Dockerfile rename to 2.4.0.M5/debian/Dockerfile-amd64 index 3737e4ee..15b23aa1 100644 --- a/2.4.0.M5/amd64/debian/Dockerfile +++ b/2.4.0.M5/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M5/arm64/debian/Dockerfile b/2.4.0.M5/debian/Dockerfile-arm64 similarity index 98% rename from 2.4.0.M5/arm64/debian/Dockerfile rename to 2.4.0.M5/debian/Dockerfile-arm64 index 26020cdc..0dc33d99 100644 --- a/2.4.0.M5/arm64/debian/Dockerfile +++ b/2.4.0.M5/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M5/armhf/debian/Dockerfile b/2.4.0.M5/debian/Dockerfile-armhf similarity index 98% rename from 2.4.0.M5/armhf/debian/Dockerfile rename to 2.4.0.M5/debian/Dockerfile-armhf index bbb91e96..247c6141 100644 --- a/2.4.0.M5/armhf/debian/Dockerfile +++ b/2.4.0.M5/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.1.0/amd64/debian/entrypoint.sh b/2.4.0.M5/debian/entrypoint.sh similarity index 100% rename from 2.1.0/amd64/debian/entrypoint.sh rename to 2.4.0.M5/debian/entrypoint.sh diff --git a/2.4.0.M5/debian/manifest.yml b/2.4.0.M5/debian/manifest.yml new file mode 100644 index 00000000..20ba6f9f --- /dev/null +++ b/2.4.0.M5/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M5-debian +tags: ['2.4.0.M5'] +manifests: + - + image: openhab/openhab:2.4.0.M5-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M5-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M5-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M6/amd64/alpine/Dockerfile b/2.4.0.M6/alpine/Dockerfile-amd64 similarity index 100% rename from 2.4.0.M6/amd64/alpine/Dockerfile rename to 2.4.0.M6/alpine/Dockerfile-amd64 diff --git a/2.4.0.M6/arm64/alpine/Dockerfile b/2.4.0.M6/alpine/Dockerfile-arm64 similarity index 100% rename from 2.4.0.M6/arm64/alpine/Dockerfile rename to 2.4.0.M6/alpine/Dockerfile-arm64 diff --git a/2.4.0.M6/armhf/alpine/Dockerfile b/2.4.0.M6/alpine/Dockerfile-armhf similarity index 100% rename from 2.4.0.M6/armhf/alpine/Dockerfile rename to 2.4.0.M6/alpine/Dockerfile-armhf diff --git a/2.2.0/arm64/alpine/entrypoint.sh b/2.4.0.M6/alpine/entrypoint.sh similarity index 100% rename from 2.2.0/arm64/alpine/entrypoint.sh rename to 2.4.0.M6/alpine/entrypoint.sh diff --git a/2.4.0.M6/alpine/manifest.yml b/2.4.0.M6/alpine/manifest.yml new file mode 100644 index 00000000..24cb49ef --- /dev/null +++ b/2.4.0.M6/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M6-alpine +tags: [] +manifests: + - + image: openhab/openhab:2.4.0.M6-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M6-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M6-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M6/amd64/alpine/entrypoint.sh b/2.4.0.M6/amd64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M6/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/amd64/debian/entrypoint.sh b/2.4.0.M6/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M6/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/arm64/alpine/entrypoint.sh b/2.4.0.M6/arm64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M6/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/arm64/debian/entrypoint.sh b/2.4.0.M6/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M6/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/armhf/alpine/entrypoint.sh b/2.4.0.M6/armhf/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M6/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/armhf/debian/entrypoint.sh b/2.4.0.M6/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M6/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M6/amd64/debian/Dockerfile b/2.4.0.M6/debian/Dockerfile-amd64 similarity index 98% rename from 2.4.0.M6/amd64/debian/Dockerfile rename to 2.4.0.M6/debian/Dockerfile-amd64 index e0d04489..df991f21 100644 --- a/2.4.0.M6/amd64/debian/Dockerfile +++ b/2.4.0.M6/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M6/arm64/debian/Dockerfile b/2.4.0.M6/debian/Dockerfile-arm64 similarity index 98% rename from 2.4.0.M6/arm64/debian/Dockerfile rename to 2.4.0.M6/debian/Dockerfile-arm64 index 1e9ae1aa..c8d729cd 100644 --- a/2.4.0.M6/arm64/debian/Dockerfile +++ b/2.4.0.M6/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M6/armhf/debian/Dockerfile b/2.4.0.M6/debian/Dockerfile-armhf similarity index 98% rename from 2.4.0.M6/armhf/debian/Dockerfile rename to 2.4.0.M6/debian/Dockerfile-armhf index 6a6d72b4..751e5337 100644 --- a/2.4.0.M6/armhf/debian/Dockerfile +++ b/2.4.0.M6/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.1.0/arm64/debian/entrypoint.sh b/2.4.0.M6/debian/entrypoint.sh similarity index 100% rename from 2.1.0/arm64/debian/entrypoint.sh rename to 2.4.0.M6/debian/entrypoint.sh diff --git a/2.4.0.M6/debian/manifest.yml b/2.4.0.M6/debian/manifest.yml new file mode 100644 index 00000000..f0a51da9 --- /dev/null +++ b/2.4.0.M6/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M6-debian +tags: ['2.4.0.M6'] +manifests: + - + image: openhab/openhab:2.4.0.M6-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M6-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M6-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M7/amd64/alpine/Dockerfile b/2.4.0.M7/alpine/Dockerfile-amd64 similarity index 100% rename from 2.4.0.M7/amd64/alpine/Dockerfile rename to 2.4.0.M7/alpine/Dockerfile-amd64 diff --git a/2.4.0.M7/arm64/alpine/Dockerfile b/2.4.0.M7/alpine/Dockerfile-arm64 similarity index 100% rename from 2.4.0.M7/arm64/alpine/Dockerfile rename to 2.4.0.M7/alpine/Dockerfile-arm64 diff --git a/2.4.0.M7/armhf/alpine/Dockerfile b/2.4.0.M7/alpine/Dockerfile-armhf similarity index 100% rename from 2.4.0.M7/armhf/alpine/Dockerfile rename to 2.4.0.M7/alpine/Dockerfile-armhf diff --git a/2.2.0/armhf/alpine/entrypoint.sh b/2.4.0.M7/alpine/entrypoint.sh similarity index 100% rename from 2.2.0/armhf/alpine/entrypoint.sh rename to 2.4.0.M7/alpine/entrypoint.sh diff --git a/2.4.0.M7/alpine/manifest.yml b/2.4.0.M7/alpine/manifest.yml new file mode 100644 index 00000000..c610f363 --- /dev/null +++ b/2.4.0.M7/alpine/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M7-alpine +tags: ['milestone-alpine'] +manifests: + - + image: openhab/openhab:2.4.0.M7-amd64-alpine + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M7-armhf-alpine + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M7-arm64-alpine + platform: + architecture: arm64 + os: linux diff --git a/2.4.0.M7/amd64/alpine/entrypoint.sh b/2.4.0.M7/amd64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M7/amd64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/amd64/debian/entrypoint.sh b/2.4.0.M7/amd64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M7/amd64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/arm64/alpine/entrypoint.sh b/2.4.0.M7/arm64/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M7/arm64/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/arm64/debian/entrypoint.sh b/2.4.0.M7/arm64/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M7/arm64/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/armhf/alpine/entrypoint.sh b/2.4.0.M7/armhf/alpine/entrypoint.sh deleted file mode 100755 index 810262ea..00000000 --- a/2.4.0.M7/armhf/alpine/entrypoint.sh +++ /dev/null @@ -1,132 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -d "${JAVA_HOME}/jre/lib/security/policy/unlimited" ]; then - echo "Installing OpenJDK unlimited strength cryptography policy..." - mkdir "${JAVA_HOME}/jre/lib/security/policy/unlimited" - apk fix --no-cache openjdk8-jre-lib -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 14 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - addgroup -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID -D -g '' -h ${APPDIR} -G openhab openhab - adduser openhab dialout - adduser openhab uucp -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar -c -f "${APPDIR}/userdata/backup/${backupFile}" --exclude "backup/*" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "su-exec openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/armhf/debian/entrypoint.sh b/2.4.0.M7/armhf/debian/entrypoint.sh deleted file mode 100755 index 00d6d130..00000000 --- a/2.4.0.M7/armhf/debian/entrypoint.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/bin/bash -x - -interactive=$(if test -t 0; then echo true; else echo false; fi) -set -euo pipefail -IFS=$'\n\t' - -# Install Java unlimited strength cryptography -if [ "${CRYPTO_POLICY}" = "unlimited" ] && [ ! -f "${JAVA_HOME}/jre/lib/security/README.txt" ]; then - echo "Installing Zulu Cryptography Extension Kit (\"CEK\")..." - wget -q -O /tmp/ZuluJCEPolicies.zip https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip - unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip - rm /tmp/ZuluJCEPolicies.zip -fi - -# Deleting instance.properties to avoid karaf PID conflict on restart -# See: https://github.com/openhab/openhab-docker/issues/99 -rm -f /openhab/runtime/instances/instance.properties - -# The instance.properties file in openHAB 2.x is installed in the tmp -# directory -rm -f /openhab/userdata/tmp/instances/instance.properties - -# Add openhab user & handle possible device groups for different host systems -# Container base image puts dialout on group id 20, uucp on id 10 -# GPIO Group for RPI access -NEW_USER_ID=${USER_ID:-9001} -NEW_GROUP_ID=${GROUP_ID:-$NEW_USER_ID} -echo "Starting with openhab user id: $NEW_USER_ID and group id: $NEW_GROUP_ID" -if ! id -u openhab >/dev/null 2>&1; then - echo "Create group openhab with id ${NEW_GROUP_ID}" - groupadd -g $NEW_GROUP_ID openhab - echo "Create user openhab with id ${NEW_USER_ID}" - adduser -u $NEW_USER_ID --disabled-password --gecos '' --home ${APPDIR} --gid $NEW_GROUP_ID openhab - groupadd -g 14 uucp2 - groupadd -g 16 dialout2 - groupadd -g 18 dialout3 - groupadd -g 32 uucp3 - groupadd -g 997 gpio - adduser openhab dialout - adduser openhab uucp - adduser openhab uucp2 - adduser openhab dialout2 - adduser openhab dialout3 - adduser openhab uucp3 - adduser openhab gpio -fi - -# Copy initial files to host volume -case ${OPENHAB_VERSION} in - 1.*) - if [ -z "$(ls -A "${APPDIR}/configurations")" ]; then - # Copy userdata dir for openHAB 1.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/configurations.dist/." "${APPDIR}/configurations/" - fi - ;; - 2.*) - # Initialize empty host volumes - if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" - fi - - # Upgrade userdata if versions do not match - if [ ! -z $(cmp "${APPDIR}/userdata/etc/version.properties" "${APPDIR}/userdata.dist/etc/version.properties") ]; then - echo "Image and userdata versions differ! Starting an upgrade." - - # Make a backup of userdata - backupFile=userdata-$(date +"%FT%H-%M-%S").tar - if [ ! -d "${APPDIR}/userdata/backup" ]; then - mkdir "${APPDIR}/userdata/backup" - fi - tar --exclude="${APPDIR}/userdata/backup" -c -f "${APPDIR}/userdata/backup/${backupFile}" "${APPDIR}/userdata" - echo "You can find backup of userdata in ${APPDIR}/userdata/backup/${backupFile}" - - # Copy over the updated files - cp "${APPDIR}/userdata.dist/etc/all.policy" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/branding-ssh.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/config.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/custom.properties" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/custom.system.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/custom.system.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/distribution.info" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/jre.properties" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.apache.karaf"* "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/org.ops4j.pax.url.mvn.cfg" "${APPDIR}/userdata/etc/" - if [ -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - cp "${APPDIR}/userdata.dist/etc/overrides.properties" "${APPDIR}/userdata/etc/" - fi - cp "${APPDIR}/userdata.dist/etc/profile.cfg" "${APPDIR}/userdata/etc/" - cp "${APPDIR}/userdata.dist/etc/startup.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/system.properties" "${APPDIR}/userdata/etc" - cp "${APPDIR}/userdata.dist/etc/version.properties" "${APPDIR}/userdata/etc/" - echo "Replaced files in userdata/etc with newer versions" - - # Remove necessary files after installation - rm -rf "${APPDIR}/userdata/etc/org.openhab.addons.cfg" - if [ ! -f "${APPDIR}/userdata.dist/etc/overrides.properties" ]; then - rm -rf "${APPDIR}/userdata/etc/overrides.properties" - fi - - # Clear the cache and tmp - rm -rf "${APPDIR}/userdata/cache" - rm -rf "${APPDIR}/userdata/tmp" - mkdir "${APPDIR}/userdata/cache" - mkdir "${APPDIR}/userdata/tmp" - echo "Cleared the cache and tmp" - fi - - if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir for openHAB 2.x - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" - fi - ;; - *) - echo openHAB version ${OPENHAB_VERSION} not supported! - ;; -esac - -# Run s6-style init continuation scripts if existent -if [ -d /etc/cont-init.d ] -then - for script in $(find /etc/cont-init.d -type f | grep -v \~ | sort) - do - . ${script} - done -fi - -# Set openhab folder permission -chown -R openhab:openhab ${APPDIR} -sync - -# Use server mode with the default command when there is no pseudo-TTY -if [ "$interactive" == "false" ] && [ "$(IFS=" "; echo "$@")" == "gosu openhab tini -s ./start.sh" ]; then - command=($@ server) - exec "${command[@]}" -else - exec "$@" -fi diff --git a/2.4.0.M7/amd64/debian/Dockerfile b/2.4.0.M7/debian/Dockerfile-amd64 similarity index 98% rename from 2.4.0.M7/amd64/debian/Dockerfile rename to 2.4.0.M7/debian/Dockerfile-amd64 index a6d0f07b..d268487c 100644 --- a/2.4.0.M7/amd64/debian/Dockerfile +++ b/2.4.0.M7/debian/Dockerfile-amd64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M7/arm64/debian/Dockerfile b/2.4.0.M7/debian/Dockerfile-arm64 similarity index 98% rename from 2.4.0.M7/arm64/debian/Dockerfile rename to 2.4.0.M7/debian/Dockerfile-arm64 index 042ab3d2..9561758b 100644 --- a/2.4.0.M7/arm64/debian/Dockerfile +++ b/2.4.0.M7/debian/Dockerfile-arm64 @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.4.0.M7/armhf/debian/Dockerfile b/2.4.0.M7/debian/Dockerfile-armhf similarity index 98% rename from 2.4.0.M7/armhf/debian/Dockerfile rename to 2.4.0.M7/debian/Dockerfile-armhf index e120af7f..185a4b19 100644 --- a/2.4.0.M7/armhf/debian/Dockerfile +++ b/2.4.0.M7/debian/Dockerfile-armhf @@ -72,7 +72,7 @@ RUN apt-get update && \ ENV JAVA_HOME='/usr/lib/java-8' RUN wget -nv -O /tmp/java.tar.gz "${JAVA_URL}" && \ mkdir "${JAVA_HOME}" && \ - tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xvf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ + tar --exclude='demo' --exclude='sample' --exclude='src.zip' -xf /tmp/java.tar.gz --strip-components=1 -C "${JAVA_HOME}" && \ rm /tmp/java.tar.gz && \ update-alternatives --install /usr/bin/java java "${JAVA_HOME}/bin/java" 50 && \ update-alternatives --install /usr/bin/javac javac "${JAVA_HOME}/bin/javac" 50 diff --git a/2.1.0/armhf/debian/entrypoint.sh b/2.4.0.M7/debian/entrypoint.sh similarity index 100% rename from 2.1.0/armhf/debian/entrypoint.sh rename to 2.4.0.M7/debian/entrypoint.sh diff --git a/2.4.0.M7/debian/manifest.yml b/2.4.0.M7/debian/manifest.yml new file mode 100644 index 00000000..1b80442d --- /dev/null +++ b/2.4.0.M7/debian/manifest.yml @@ -0,0 +1,18 @@ +image: openhab/openhab:2.4.0.M7-debian +tags: ['2.4.0.M7','milestone','milestone-debian'] +manifests: + - + image: openhab/openhab:2.4.0.M7-amd64-debian + platform: + architecture: amd64 + os: linux + - + image: openhab/openhab:2.4.0.M7-armhf-debian + platform: + architecture: arm + os: linux + - + image: openhab/openhab:2.4.0.M7-arm64-debian + platform: + architecture: arm64 + os: linux diff --git a/README.md b/README.md index 99462b6c..ff7b3abd 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ![](images/openhab.png) -[![Build state](https://travis-ci.org/openhab/openhab-docker.svg?branch=master)](https://travis-ci.org/openhab/openhab-docker) [![](https://images.microbadger.com/badges/image/openhab/openhab:2.3.0-amd64-debian.svg)](https://microbadger.com/images/openhab/openhab:2.3.0-amd64-debian "Get your own image badge on microbadger.com") [![Docker Label](https://images.microbadger.com/badges/version/openhab/openhab:2.3.0-amd64-debian.svg)](https://microbadger.com/#/images/openhab/openhab:2.3.0-amd64-debian) [![Docker Stars](https://img.shields.io/docker/stars/openhab/openhab.svg?maxAge=2592000)](https://hub.docker.com/r/openhab/openhab/) [![Docker Pulls](https://img.shields.io/docker/pulls/openhab/openhab.svg?maxAge=2592000)](https://hub.docker.com/r/openhab/openhab/) [![Join the chat at https://gitter.im/openhab/openhab-docker](https://badges.gitter.im/openhab/openhab-docker.svg)](https://gitter.im/openhab/openhab-docker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) +[![Build state](https://travis-ci.org/openhab/openhab-docker.svg?branch=master)](https://travis-ci.org/openhab/openhab-docker) [![](https://images.microbadger.com/badges/image/openhab/openhab:2.3.0.svg)](https://microbadger.com/images/openhab/openhab:2.3.0 "Get your own image badge on microbadger.com") [![Docker Label](https://images.microbadger.com/badges/version/openhab/openhab:2.3.0.svg)](https://microbadger.com/#/images/openhab/openhab:2.3.0) [![Docker Stars](https://img.shields.io/docker/stars/openhab/openhab.svg?maxAge=2592000)](https://hub.docker.com/r/openhab/openhab/) [![Docker Pulls](https://img.shields.io/docker/pulls/openhab/openhab.svg?maxAge=2592000)](https://hub.docker.com/r/openhab/openhab/) [![Join the chat at https://gitter.im/openhab/openhab-docker](https://badges.gitter.im/openhab/openhab-docker.svg)](https://gitter.im/openhab/openhab-docker?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [![GitHub issues](https://img.shields.io/github/issues/openhab/openhab-docker.svg)](https://github.com/openhab/openhab-docker/issues) [![GitHub forks](https://img.shields.io/github/forks/openhab/openhab-docker.svg)](https://github.com/openhab/openhab-docker/network) [![GitHub stars](https://img.shields.io/github/stars/openhab/openhab-docker.svg)](https://github.com/openhab/openhab-docker/stargazers) @@ -41,36 +41,54 @@ Comments, suggestions and contributions are welcome! ## Image variants -`openhab/openhab:--` +* For specific versions use: + - `openhab/openhab:` + - `openhab/openhab:-` + - `openhab/openhab:--` -**Version** +* For the latest stable release use: + - `openhab/openhab` + - `openhab/openhab:latest` + - `openhab/openhab:latest-` + +* For the latest release that has a milestone or stable maturity use: + - `openhab/openhab:milestone` + - `openhab/openhab:milestone-` + +* For the latest snapshot release use: + - `openhab/openhab:snapshot` + - `openhab/openhab:snapshot-` + +**Versions:** -* `1.8.3` Stable openHAB 1.8.3 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/1.8.3/amd64/debian/Dockerfile)) -* `2.0.0` Stable openHAB 2.0.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.0.0/amd64/debian/Dockerfile)) -* `2.1.0` Stable openHAB 2.1.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.1.0/amd64/debian/Dockerfile)) -* `2.2.0` Stable openHAB 2.2.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.2.0/amd64/debian/Dockerfile)) -* `2.3.0` Stable openHAB 2.3.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.3.0/amd64/debian/Dockerfile)) -* `2.4.0.M5` Experimental openHAB 2.4.0.M5 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M5/amd64/debian/Dockerfile)) -* `2.4.0.M6` Experimental openHAB 2.4.0.M6 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M6/amd64/debian/Dockerfile)) -* `2.4.0.M7` Experimental openHAB 2.4.0.M7 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M7/amd64/debian/Dockerfile)) -* `2.4.0-snapshot` Experimental openHAB 2.4.0 SNAPSHOT version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0-snapshot/amd64/debian/Dockerfile)) +* `1.8.3` Stable openHAB 1.8.3 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/1.8.3/debian/Dockerfile-amd64)) +* `2.0.0` Stable openHAB 2.0.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.0.0/debian/Dockerfile-amd64)) +* `2.1.0` Stable openHAB 2.1.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.1.0/debian/Dockerfile-amd64)) +* `2.2.0` Stable openHAB 2.2.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.2.0/debian/Dockerfile-amd64)) +* `2.3.0` Stable openHAB 2.3.0 version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.3.0/debian/Dockerfile-amd64)) +* `2.4.0.M5` Experimental openHAB 2.4.0.M5 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M5/debian/Dockerfile-amd64)) +* `2.4.0.M6` Experimental openHAB 2.4.0.M6 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M6/debian/Dockerfile-amd64)) +* `2.4.0.M7` Experimental openHAB 2.4.0.M7 Milestone version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0.M7/debian/Dockerfile-amd64)) +* `2.4.0-snapshot` Experimental openHAB 2.4.0 SNAPSHOT version ([Dockerfile](https://github.com/openhab/openhab-docker/blob/master/2.4.0-snapshot/debian/Dockerfile-amd64)) -**Architecture:** +**Architectures:** * `amd64` for most desktop computer (e.g. x64, x86-64, x86_64) * `armhf` for ARMv7 devices 32 Bit (e.g. most RaspberryPi 1/2/3) * `arm64` for ARMv8 devices 64 Bit (not RaspberryPi 3) +Newer Docker versions (1.10.0+) have multi-architecture support which allows for omitting the architecture from the tag. + **Distributions:** -* `debian` for debian stretch +* `debian` for debian stretch (default when not specified in tag) * `alpine` for alpine 3.8 The alpine images are substantially smaller than the debian images but may be less compatible because OpenJDK is used (see [Prerequisites](https://www.openhab.org/docs/installation/#prerequisites) for known disadvantages). -If you are unsure about what your needs are, you probably want to use `openhab/openhab:2.3.0-amd64-debian`. +If you are unsure about what your needs are, you probably want to use `openhab/openhab:2.3.0`. Prebuilt Docker Images can be found here: [Docker Images](https://hub.docker.com/r/openhab/openhab) @@ -82,7 +100,7 @@ Prebuilt Docker Images can be found here: [Docker Images](https://hub.docker.com The following will run openHAB in demo mode on the host machine: -`docker run --name openhab --net=host openhab/openhab:2.3.0-amd64-debian` +`docker run --name openhab --net=host openhab/openhab:2.3.0` _**NOTE:** Although this is the simplest method to getting openHAB up and running, but it is not the preferred method. To properly run the container, please specify a **host volume** for the directories._ @@ -109,7 +127,7 @@ docker run \ -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Berlin" \ -d \ --restart=always \ - openhab/openhab:2.3.0-amd64-debian + openhab/openhab:2.3.0 ``` #### Running from compose-file.yml @@ -121,7 +139,7 @@ version: '2.2' services: openhab: - image: "openhab/openhab:2.3.0-amd64-debian" + image: "openhab/openhab:2.3.0" restart: always network_mode: host volumes: @@ -143,7 +161,7 @@ version: '2.2' services: openhab: - image: "openhab/openhab:2.3.0-amd64-debian" + image: "openhab/openhab:2.3.0" restart: always network_mode: host volumes: @@ -178,7 +196,7 @@ version: '2.2' services: openhab: container_name: openhab - image: "openhab/openhab:2.3.0-amd64-debian" + image: "openhab/openhab:2.3.0" restart: always network_mode: host cap_add: @@ -213,7 +231,7 @@ docker run \ -v /opt/openhab/conf:/openhab/conf \ -v /opt/openhab/userdata:/openhab/userdata \ -e "EXTRA_JAVA_OPTS=-Duser.timezone=Europe/Berlin" \ - openhab/openhab:2.3.0-amd64-debian + openhab/openhab:2.3.0 ``` ### Automating Docker setup using Ansible (for advanced user) @@ -229,7 +247,7 @@ Here is an example playbook in case you control your environment with Ansible. Y tags: openhab docker_container: name: openhab - image: openhab/openhab:2.3.0-amd64-alpine + image: openhab/openhab:2.3.0 state: started detach: yes interactive: yes @@ -271,7 +289,7 @@ The default password for the login is `habopen`. The container starts openHAB in server mode when no TTY is provided, example: -`docker run --detach --name openhab openhab/openhab:2.3.0-amd64-debian` +`docker run --detach --name openhab openhab/openhab:2.3.0` When the container runs in server mode you can also add a console logger so it prints logging to stdout so you can check the logging of a container named "openhab" with: @@ -286,13 +304,13 @@ To add the console logger, edit `userdata/etc/org.ops4j.pax.logging.cfg` and the When a TTY is provided openHAB is started with an interactive console, e.g.: -`docker run -it openhab/openhab:2.3.0-amd64-debian` +`docker run -it openhab/openhab:2.3.0` #### Debug mode The debug mode is started with the command: -`docker run -it openhab/openhab:2.3.0-amd64-debian ./start_debug.sh` +`docker run -it openhab/openhab:2.3.0 ./start_debug.sh` ## Environment variables @@ -386,7 +404,7 @@ $ docker run --rm --privileged multiarch/qemu-user-static:register --reset It is sometimes useful to run shell scripts after the "userdata" directory is created, but before karaf itself is launched. One such case is creating SSH host keys, and allowing access to the system from the outside via SSH. -Exemplary scripts can be found in the ([contrib] (https://github.com/openhab/openhab-docker/tree/contrib) directory +Exemplary scripts can be found in the [contrib](https://github.com/openhab/openhab-docker/tree/master/contrib) directory To use this, create a directory called @@ -408,7 +426,7 @@ This can be done by either using a volume mount (see the examples above) or crea ### Show the contents of the runnig docker image -([10-show-directories] https://github.com/openhab/openhab-docker/blob/master/contrib/cont-init.d/10-show-directories) +[10-show-directories](https://github.com/openhab/openhab-docker/blob/master/contrib/cont-init.d/10-show-directories) ```shell ls -l /openhab @@ -417,7 +435,7 @@ ls -l /openhab/userdata ### Set a defined host key for the image -([20-set-host-key] https://github.com/openhab/openhab-docker/blob/master/contrib/cont-init.d/20-set-host-key) +[20-set-host-key](https://github.com/openhab/openhab-docker/blob/master/contrib/cont-init.d/20-set-host-key) ```shell cat > /openhab/userdata/etc/host.key < /openhab/userdata/etc/keys.properties </dev/null + echo -n "Writing $file... " + print_header $file; + print_baseimage $file; + print_basemetadata $file; + if [ "$base" == "alpine" ]; then + print_basepackages_alpine $file; + print_java_alpine $file; + else + print_basepackages_debian $file; + print_java_debian $file; + fi + if [ "$arch" == "arm64" ] && [ "$base" == "debian" ]; then + print_lib32_support_arm64 $file; + fi + if [ "$version" == "1."* ]; then + print_openhab_install_oh1 $file; + print_volumes_oh1 $file + else + print_openhab_install_oh2 $file; + print_volumes_oh2 $file + fi + print_expose_ports $file + print_entrypoint $file + print_command $file + + echo "done" + done +} + +generate_manifest() { + tags=() + + if [ "$base" == "debian" ]; then + tags+=("'$version'") + fi + + if [ "$version" == "$(last_stable_version)" ]; then + if [ "$base" == "debian" ]; then + tags+=("'latest'") + fi + tags+=("'latest-$base'") + fi + + milestone_maturity_version="$(last_milestone_version)" + if [ "$milestone_maturity_version" == "" ] ; then + milestone_maturity_version="$(last_stable_version)" + fi + + if [ "$version" == "$milestone_maturity_version" ]; then + if [ "$base" == "debian" ]; then + tags+=("'milestone'") + fi + tags+=("'milestone-$base'") + fi + + if [ "$version" == "$(snapshot_version)" ]; then + if [ "$base" == "debian" ]; then + tags+=("'snapshot'") + fi + tags+=("'snapshot-$base'") + fi + + tags=$(IFS=,; echo "${tags[*]}") + + cat >> $1 <<-EOI + image: $docker_repo:$version-$base + tags: [$tags] + manifests: + - + image: $docker_repo:$version-amd64-$base + platform: + architecture: amd64 + os: linux + - + image: $docker_repo:$version-armhf-$base + platform: + architecture: arm + os: linux + - + image: $docker_repo:$version-arm64-$base + platform: + architecture: arm64 + os: linux +EOI +} + # Remove previously generated container files rm -rf ./1.* ./2.* @@ -328,50 +420,19 @@ for version in $(build_versions) do for base in $bases do - for arch in $arches - do - # Generate Dockerfile - file=$version/$arch/$base/Dockerfile - mkdir -p $(dirname $file) 2>/dev/null - echo -n "Writing $file... " - print_header $file; - print_baseimage $file; - print_basemetadata $file; - if [ "$base" == "alpine" ]; then - print_basepackages_alpine $file; - print_java_alpine $file; - else - print_basepackages_debian $file; - print_java_debian $file; - fi - if [ "$arch" == "arm64" ] && [ "$base" == "debian" ]; then - print_lib32_support_arm64 $file; - fi - if [ "$version" == "1."* ]; then - print_openhab_install_oh1 $file; - print_volumes_oh1 $file - else - print_openhab_install_oh2 $file; - print_volumes_oh2 $file - fi - print_expose_ports $file - print_entrypoint $file - print_command $file - - # Generate entrypoint.sh - file=$version/$arch/$base/entrypoint.sh - if [ "$base" == "alpine" ]; then - cp entrypoint-alpine.sh $file - # Remove bugfix for version 2 from entrypoint-alpine.sh - if [ "$version" == "1."* ]; then - line=$(sed "/rm -f \/openhab\/userdata\/tmp\/instances\/instance.properties/=; d" entrypoint-alpine.sh) - sed -i "$((line-7)),${line}"d $file - fi - else - cp entrypoint-debian.sh $file - fi - - echo "done" - done + # Generate Dockerfile per architecture + generate_docker_files + + # Generate multi-architecture manifest + file="$version/$base/manifest.yml" + generate_manifest $file + + # Copy base specific entrypoint.sh + file="$version/$base/entrypoint.sh" + if [ "$base" == "alpine" ]; then + cp entrypoint-alpine.sh $file + else + cp entrypoint-debian.sh $file + fi done done diff --git a/update-functions.sh b/update-functions.sh index 76f5b122..3ce6c858 100755 --- a/update-functions.sh +++ b/update-functions.sh @@ -4,6 +4,7 @@ set -eo pipefail # Supported architectures and base images arches="amd64 arm64 armhf" bases="alpine debian" +docker_repo=${DOCKER_REPO:=openhab/openhab} last_stable_version() { echo "$(grep -E '^[0-9]+\.[0-9]+\.[0-9]+$' versions | sort --unique --version-sort | tail -n 1)" @@ -22,6 +23,10 @@ milestone_versions() { echo "$(grep -E $(next_stable_version)\.M[0-9]+$ versions | sort --unique --version-sort | tail -n 3)" } +last_milestone_version() { + echo "$(grep -E $(next_stable_version)\.M[0-9]+$ versions | sort --unique --version-sort | tail -n 1)" +} + snapshot_version() { echo "$(next_stable_version)-snapshot" } diff --git a/update-readme.sh b/update-readme.sh index 8ab848b9..0eb571d7 100755 --- a/update-readme.sh +++ b/update-readme.sh @@ -4,7 +4,7 @@ set -eo pipefail . update-functions.sh file=README.md -dockerfile_url='https://github.com/openhab/openhab-docker/blob/master/${version}/amd64/debian/Dockerfile' +dockerfile_url='https://github.com/openhab/openhab-docker/blob/master/${version}/debian/Dockerfile-amd64' generated_content_marker="" generate_version_list() { diff --git a/update-travis-config.sh b/update-travis-config.sh index 7ac9e36d..94cd3f1b 100755 --- a/update-travis-config.sh +++ b/update-travis-config.sh @@ -25,15 +25,22 @@ print_static_configuration() { before_install: - sudo apt-get install -y uidmap - ./update-docker-files.sh - - ./update-img.sh + - ./install-img.sh + - ./install-manifest-tool.sh - docker info - docker run --rm --privileged multiarch/qemu-user-static:register --reset + - ARCHES="amd64 armhf arm64" install: - - docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") --build-arg VERSION=$VERSION -t $DOCKER_REPO:$VERSION-$TARGET-$DIST $VERSION/$TARGET/$DIST - - docker run --rm $DOCKER_REPO:$VERSION-$TARGET-$DIST uname -a + - for ARCH in $ARCHES; do + docker build --build-arg VCS_REF=$TRAVIS_COMMIT --build-arg BUILD_DATE=$(date +"%Y-%m-%dT%H:%M:%SZ") --build-arg VERSION=$VERSION -f $VERSION/$DIST/Dockerfile-$ARCH -t $DOCKER_REPO:$VERSION-$ARCH-$DIST $VERSION/$DIST; + docker run --rm $DOCKER_REPO:$VERSION-$ARCH-$DIST uname -a; + done after_success: - docker login -u=$DOCKER_USERNAME -p=$DOCKER_PASSWORD - - docker push $DOCKER_REPO:$VERSION-$TARGET-$DIST + - for ARCH in $ARCHES; do + docker push $DOCKER_REPO:$VERSION-$ARCH-$DIST; + done + - manifest-tool push from-spec $VERSION/$DIST/manifest.yml matrix: fast_finish: true env: @@ -44,7 +51,7 @@ EOI # Print Travis matrix environment variables print_matrix() { cat >> $1 <<-EOI - - VERSION=$version DIST=$base TARGET=$arch + - VERSION=$version DIST=$base EOI } @@ -58,10 +65,7 @@ for version in $(build_versions) do for base in $bases do - for arch in $arches - do - print_matrix $file; - done + print_matrix $file; done done