|
| 1 | +# openhab image |
| 2 | +# |
| 3 | +# ------------------------------------------------------------------------------ |
| 4 | +# NOTE: THIS DOCKERFILE IS GENERATED VIA "update.sh" |
| 5 | +# |
| 6 | +# PLEASE DO NOT EDIT IT DIRECTLY. |
| 7 | +# ------------------------------------------------------------------------------ |
| 8 | +# |
| 9 | +FROM multiarch/debian-debootstrap:arm64-jessie |
| 10 | + |
| 11 | +# Set download urls |
| 12 | +ENV JAVA_URL="https://www.azul.com/downloads/zulu/zdk-8-ga-linux_aarch32hf.tar.gz" OPENHAB_URL="https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab/target/openhab-2.3.0-SNAPSHOT.zip" OPENHAB_VERSION="2.3.0-snapshot" |
| 13 | + |
| 14 | +# Set variables and locales |
| 15 | +ENV \ |
| 16 | + APPDIR="/openhab" \ |
| 17 | + EXTRA_JAVA_OPTS="" \ |
| 18 | + OPENHAB_HTTP_PORT="8080" \ |
| 19 | + OPENHAB_HTTPS_PORT="8443" \ |
| 20 | + LC_ALL=en_US.UTF-8 \ |
| 21 | + LANG=en_US.UTF-8 \ |
| 22 | + LANGUAGE=en_US.UTF-8 |
| 23 | + |
| 24 | +# Set arguments on build |
| 25 | +ARG BUILD_DATE |
| 26 | +ARG VCS_REF |
| 27 | +ARG VERSION |
| 28 | + |
| 29 | +# Basic build-time metadata as defined at http://label-schema.org |
| 30 | +LABEL org.label-schema.build-date=$BUILD_DATE \ |
| 31 | + org.label-schema.docker.dockerfile="/Dockerfile" \ |
| 32 | + org.label-schema.license="EPL" \ |
| 33 | + org.label-schema.name="openHAB" \ |
| 34 | + org.label-schema.vendor="openHAB Foundation e.V." \ |
| 35 | + org.label-schema.version=$VERSION \ |
| 36 | + org.label-schema.description="An open source, technology agnostic home automation platform" \ |
| 37 | + org.label-schema.url="http://www.openhab.com/" \ |
| 38 | + org.label-schema.vcs-ref=$VCS_REF \ |
| 39 | + org.label-schema.vcs-type="Git" \ |
| 40 | + org.label-schema.vcs-url="https://github.com/openhab/openhab-docker.git" \ |
| 41 | + maintainer="openHAB <info@openhabfoundation.org>" |
| 42 | + |
| 43 | +# Install basepackages |
| 44 | +RUN apt-get update && \ |
| 45 | + DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \ |
| 46 | + ca-certificates \ |
| 47 | + fontconfig \ |
| 48 | + locales \ |
| 49 | + locales-all \ |
| 50 | + libpcap-dev \ |
| 51 | + netbase \ |
| 52 | + unzip \ |
| 53 | + wget \ |
| 54 | + zip && \ |
| 55 | + rm -rf /var/lib/apt/lists/* && \ |
| 56 | +ln -s -f /bin/true /usr/bin/chfn |
| 57 | + |
| 58 | +# Install java |
| 59 | +ENV JAVA_HOME='/usr/lib/java-8' |
| 60 | +RUN wget -nv -O /tmp/java.tar.gz ${JAVA_URL} && \ |
| 61 | + mkdir ${JAVA_HOME} && \ |
| 62 | + tar -xvf /tmp/java.tar.gz --strip-components=1 -C ${JAVA_HOME} && \ |
| 63 | + rm /tmp/java.tar.gz && \ |
| 64 | + update-alternatives --install /usr/bin/java java ${JAVA_HOME}/bin/java 50 && \ |
| 65 | + update-alternatives --install /usr/bin/javac javac ${JAVA_HOME}/bin/javac 50 |
| 66 | +RUN cd /tmp \ |
| 67 | + && wget https://cdn.azul.com/zcek/bin/ZuluJCEPolicies.zip \ |
| 68 | + && unzip -jo -d ${JAVA_HOME}/jre/lib/security /tmp/ZuluJCEPolicies.zip \ |
| 69 | + && rm /tmp/ZuluJCEPolicies.zip |
| 70 | + |
| 71 | +# Install gosu |
| 72 | +ENV GOSU_VERSION 1.10 |
| 73 | +RUN set -x \ |
| 74 | + && dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" \ |
| 75 | + && wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" \ |
| 76 | + && wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" \ |
| 77 | + && export GNUPGHOME \ |
| 78 | + && GNUPGHOME="$(mktemp -d)" \ |
| 79 | + && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ |
| 80 | + && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ |
| 81 | + && rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc \ |
| 82 | + && chmod +x /usr/local/bin/gosu |
| 83 | + |
| 84 | +RUN dpkg --add-architecture armhf && \ |
| 85 | + apt-get update && \ |
| 86 | + apt-get install --no-install-recommends -y \ |
| 87 | + libc6:armhf && \ |
| 88 | + rm -rf /var/lib/apt/lists/* |
| 89 | + |
| 90 | +# Install openhab |
| 91 | +# Set permissions for openhab. Export TERM variable. See issue #30 for details! |
| 92 | +RUN wget -nv -O /tmp/openhab.zip ${OPENHAB_URL} && \ |
| 93 | + unzip -q /tmp/openhab.zip -d ${APPDIR} && \ |
| 94 | + rm /tmp/openhab.zip && \ |
| 95 | + mkdir -p ${APPDIR}/userdata/logs && \ |
| 96 | + touch ${APPDIR}/userdata/logs/openhab.log && \ |
| 97 | + cp -a ${APPDIR}/userdata ${APPDIR}/userdata.dist && \ |
| 98 | + cp -a ${APPDIR}/conf ${APPDIR}/conf.dist && \ |
| 99 | + echo "export TERM=dumb" | tee -a ~/.bashrc |
| 100 | + |
| 101 | +# Expose volume with configuration and userdata dir |
| 102 | +VOLUME ${APPDIR}/conf ${APPDIR}/userdata ${APPDIR}/addons |
| 103 | + |
| 104 | +# Set working directory, expose and entrypoint |
| 105 | +WORKDIR ${APPDIR} |
| 106 | +EXPOSE 8080 8443 5555 |
| 107 | +COPY entrypoint.sh / |
| 108 | +RUN chmod +x /entrypoint.sh |
| 109 | +ENTRYPOINT ["/entrypoint.sh"] |
| 110 | + |
| 111 | +# Execute command |
| 112 | +CMD ["gosu", "openhab", "./start.sh"] |
0 commit comments