diff --git a/.travis.yml b/.travis.yml index a60ba6a..e062259 100644 --- a/.travis.yml +++ b/.travis.yml @@ -22,6 +22,9 @@ env: # - DOCKER_USERNAME # - DOCKER_PASSWORD matrix: + - TARGET=amd64 VERSION=1.8.3 + - TARGET=armhf VERSION=1.8.3 + - TARGET=arm64 VERSION=1.8.3 - TARGET=amd64 VERSION=2.0.0 - TARGET=armhf VERSION=2.0.0 - TARGET=arm64 VERSION=2.0.0 diff --git a/1.8.3/amd64/Dockerfile b/1.8.3/amd64/Dockerfile new file mode 100644 index 0000000..0f965f4 --- /dev/null +++ b/1.8.3/amd64/Dockerfile @@ -0,0 +1,83 @@ +# openhab image +# +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# + +FROM multiarch/debian-debootstrap:amd64-jessie + +# Set download urls +ENV OPENHAB_URL="https://bintray.com/artifact/download/openhab/bin/distribution-1.8.3-runtime.zip" +ENV JAVA_URL="https://www.azul.com/downloads/zulu/zdk-8-ga-linux_x64.tar.gz" + +# Set variables +ENV \ + APPDIR="/openhab" \ + EXTRA_JAVA_OPTS="" \ + JAVA_HOME='/usr/lib/java-8' \ + OPENHAB_HTTP_PORT="8080" \ + OPENHAB_HTTPS_PORT="8443" \ + USER_ID="9001" + +# Basic build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.docker.dockerfile="/Dockerfile" \ + org.label-schema.license="EPL" \ + org.label-schema.name="openHAB" \ + org.label-schema.url="http://www.openhab.com/" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-type="Git" \ + org.label-schema.vcs-url="https://github.com/openhab/openhab-docker.git" + +# Install basepackages +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates \ + unzip \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Install java +RUN wget -nv -O /tmp/java.tar.gz ${JAVA_URL} &&\ + mkdir ${JAVA_HOME} && \ + tar -xvf /tmp/java.tar.gz --strip-components=1 -C ${JAVA_HOME} && \ + update-alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 50 && \ + update-alternatives --install /usr/bin/javac javac ${JAVA_HOME}/bin/javac 50 + +# 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 +RUN adduser -u $USER_ID --disabled-password --gecos '' --home ${APPDIR} 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 + +# Install openhab +# Set permissions for openhab. Export TERM variable. See issue #30 for details! +RUN wget -nv -O /tmp/openhab.zip ${OPENHAB_URL} &&\ + unzip -q /tmp/openhab.zip -d ${APPDIR} &&\ + rm /tmp/openhab.zip &&\ + chown -R openhab:openhab ${APPDIR} && \ + echo "export TERM=dumb" | tee -a ~/.bashrc + +# Expose volume with configuration and userdata dir +WORKDIR ${APPDIR} +VOLUME ${APPDIR}/configurations ${APPDIR}/addons +EXPOSE 8080 8443 5555 +USER openhab +CMD ["./start.sh"] + diff --git a/1.8.3/arm64/Dockerfile b/1.8.3/arm64/Dockerfile new file mode 100644 index 0000000..982ab27 --- /dev/null +++ b/1.8.3/arm64/Dockerfile @@ -0,0 +1,90 @@ +# openhab image +# +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# + + +FROM multiarch/debian-debootstrap:arm64-jessie + +# Set download urls +ENV OPENHAB_URL="https://bintray.com/artifact/download/openhab/bin/distribution-1.8.3-runtime.zip" +ENV JAVA_URL="https://www.azul.com/downloads/zulu/zdk-8-ga-linux_aarch32hf.tar.gz" + +# Set variables +ENV \ + APPDIR="/openhab" \ + EXTRA_JAVA_OPTS="" \ + JAVA_HOME='/usr/lib/java-8' \ + OPENHAB_HTTP_PORT="8080" \ + OPENHAB_HTTPS_PORT="8443" \ + USER_ID="9001" + +# Basic build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.docker.dockerfile="/Dockerfile" \ + org.label-schema.license="EPL" \ + org.label-schema.name="openHAB" \ + org.label-schema.url="http://www.openhab.com/" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-type="Git" \ + org.label-schema.vcs-url="https://github.com/openhab/openhab-docker.git" + +# Install basepackages +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates \ + unzip \ + wget \ + && rm -rf /var/lib/apt/lists/* + +RUN dpkg --add-architecture armhf && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + libc6:armhf \ + && rm -rf /var/lib/apt/lists/* + +# Install java +RUN wget -nv -O /tmp/java.tar.gz ${JAVA_URL} &&\ + mkdir ${JAVA_HOME} && \ + tar -xvf /tmp/java.tar.gz --strip-components=1 -C ${JAVA_HOME} && \ + update-alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 50 && \ + update-alternatives --install /usr/bin/javac javac ${JAVA_HOME}/bin/javac 50 + +# 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 +RUN adduser -u $USER_ID --disabled-password --gecos '' --home ${APPDIR} 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 + +# Install openhab +# Set permissions for openhab. Export TERM variable. See issue #30 for details! +RUN wget -nv -O /tmp/openhab.zip ${OPENHAB_URL} &&\ + unzip -q /tmp/openhab.zip -d ${APPDIR} &&\ + rm /tmp/openhab.zip &&\ + chown -R openhab:openhab ${APPDIR} && \ + echo "export TERM=dumb" | tee -a ~/.bashrc + +# Expose volume with configuration and userdata dir +WORKDIR ${APPDIR} +VOLUME ${APPDIR}/configurations ${APPDIR}/addons +EXPOSE 8080 8443 5555 +USER openhab +CMD ["./start.sh"] + diff --git a/1.8.3/armhf/Dockerfile b/1.8.3/armhf/Dockerfile new file mode 100644 index 0000000..60198a5 --- /dev/null +++ b/1.8.3/armhf/Dockerfile @@ -0,0 +1,83 @@ +# openhab image +# +# ------------------------------------------------------------------------------ +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" +# +# PLEASE DO NOT EDIT IT DIRECTLY. +# ------------------------------------------------------------------------------ +# + +FROM multiarch/debian-debootstrap:armhf-jessie + +# Set download urls +ENV OPENHAB_URL="https://bintray.com/artifact/download/openhab/bin/distribution-1.8.3-runtime.zip" +ENV JAVA_URL="https://www.azul.com/downloads/zulu/zdk-8-ga-linux_aarch32hf.tar.gz" + +# Set variables +ENV \ + APPDIR="/openhab" \ + EXTRA_JAVA_OPTS="" \ + JAVA_HOME='/usr/lib/java-8' \ + OPENHAB_HTTP_PORT="8080" \ + OPENHAB_HTTPS_PORT="8443" \ + USER_ID="9001" + +# Basic build-time metadata as defined at http://label-schema.org +ARG BUILD_DATE +ARG VCS_REF +LABEL org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.docker.dockerfile="/Dockerfile" \ + org.label-schema.license="EPL" \ + org.label-schema.name="openHAB" \ + org.label-schema.url="http://www.openhab.com/" \ + org.label-schema.vcs-ref=$VCS_REF \ + org.label-schema.vcs-type="Git" \ + org.label-schema.vcs-url="https://github.com/openhab/openhab-docker.git" + +# Install basepackages +RUN apt-get update && \ + apt-get install --no-install-recommends -y \ + ca-certificates \ + unzip \ + wget \ + && rm -rf /var/lib/apt/lists/* + +# Install java +RUN wget -nv -O /tmp/java.tar.gz ${JAVA_URL} &&\ + mkdir ${JAVA_HOME} && \ + tar -xvf /tmp/java.tar.gz --strip-components=1 -C ${JAVA_HOME} && \ + update-alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 50 && \ + update-alternatives --install /usr/bin/javac javac ${JAVA_HOME}/bin/javac 50 + +# 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 +RUN adduser -u $USER_ID --disabled-password --gecos '' --home ${APPDIR} 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 + +# Install openhab +# Set permissions for openhab. Export TERM variable. See issue #30 for details! +RUN wget -nv -O /tmp/openhab.zip ${OPENHAB_URL} &&\ + unzip -q /tmp/openhab.zip -d ${APPDIR} &&\ + rm /tmp/openhab.zip &&\ + chown -R openhab:openhab ${APPDIR} && \ + echo "export TERM=dumb" | tee -a ~/.bashrc + +# Expose volume with configuration and userdata dir +WORKDIR ${APPDIR} +VOLUME ${APPDIR}/configurations ${APPDIR}/addons +EXPOSE 8080 8443 5555 +USER openhab +CMD ["./start.sh"] + diff --git a/README.md b/README.md index 8c9e4df..2b0c859 100644 --- a/README.md +++ b/README.md @@ -27,8 +27,9 @@ When not explicitly set, files are placed under [![Eclipse license](https://img. #### Version: -* [``2.0.0`` Stable openHAB version](https://github.com/openhab/openhab-docker/blob/master/2.0.0/amd64/Dockerfile) -* [``2.1.0-SNAPSHOT`` Experimental openHAB snapshot version](https://github.com/openhab/openhab-docker/blob/master/2.1.0-snapshot/amd64/Dockerfile) +* [``1.8.3`` Stable openHAB 1 version](https://github.com/openhab/openhab-docker/blob/master/1.8.3/amd64/Dockerfile) +* [``2.0.0`` Stable openHAB 2 version](https://github.com/openhab/openhab-docker/blob/master/2.0.0/amd64/Dockerfile) +* [``2.1.0-snapshot`` Experimental openHAB 2 SNAPSHOT version](https://github.com/openhab/openhab-docker/blob/master/2.1.0-snapshot/amd64/Dockerfile) #### Architecture: diff --git a/entrypoint.sh b/entrypoint.sh deleted file mode 100755 index 85ab687..0000000 --- a/entrypoint.sh +++ /dev/null @@ -1,28 +0,0 @@ -#!/bin/bash -x -set -euo pipefail -IFS=$'\n\t' - -# Initialize empty host volumes -if [ -z "$(ls -A "${APPDIR}/userdata")" ]; then - # Copy userdata dir - echo "No userdata found... initializing." - cp -av "${APPDIR}/userdata.dist/." "${APPDIR}/userdata/" -fi - -if [ -z "$(ls -A "${APPDIR}/conf")" ]; then - # Copy userdata dir - echo "No configuration found... initializing." - cp -av "${APPDIR}/conf.dist/." "${APPDIR}/conf/" -fi - -# Prettier interface -if [ "$1" = 'server' ] || [ "$1" = 'openhab' ]; then - gosu openhab "${APPDIR}/start.sh" -elif [ "$1" = 'debug' ]; then - gosu openhab "${APPDIR}/start_debug.sh" -elif [ "$1" = 'console' ] || [ "$1" = 'shell' ]; then - gosu openhab "${APPDIR}/runtime/bin/client" -else - gosu openhab "$@" -fi -