forked from openhab/openhab-docker
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add files for parameterized matrixbuild
- Loading branch information
Showing
3 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# openhab image for armv7hf | ||
FROM cyberkov/openhab-base:arm7hf | ||
|
||
ARG DOWNLOAD_URL="https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-offline/target/openhab-offline-2.0.0-SNAPSHOT.zip" | ||
ENV APPDIR="/openhab" | ||
RUN [ "cross-build-start" ] | ||
|
||
# Add openhab user | ||
RUN adduser --disabled-password --gecos '' --home ${APPDIR} openhab &&\ | ||
adduser openhab sudo &&\ | ||
adduser openhab dialout &&\ | ||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/openhab | ||
|
||
WORKDIR ${APPDIR} | ||
|
||
RUN \ | ||
wget -nv -O /tmp/openhab.zip ${DOWNLOAD_URL} &&\ | ||
unzip -q /tmp/openhab.zip -d ${APPDIR} &&\ | ||
rm /tmp/openhab.zip | ||
|
||
RUN mkdir -p ${APPDIR}/userdata/logs && touch ${APPDIR}/userdata/logs/openhab.log | ||
|
||
# Copy directories for host volumes | ||
RUN cp -a /openhab/userdata /openhab/userdata.dist && \ | ||
cp -a /openhab/conf /openhab/conf.dist | ||
COPY ./entrypoint.sh / | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
RUN chown -R openhab:openhab ${APPDIR} | ||
RUN [ "cross-build-end" ] | ||
USER openhab | ||
# Expose volume with configuration and userdata dir | ||
VOLUME ${APPDIR}/conf ${APPDIR}/userdata | ||
EXPOSE 8080 8443 5555 | ||
CMD server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# openhab image for x86 | ||
FROM cyberkov/openhab-base:latest | ||
|
||
ARG DOWNLOAD_URL="https://openhab.ci.cloudbees.com/job/openHAB-Distribution/lastSuccessfulBuild/artifact/distributions/openhab-offline/target/openhab-offline-2.0.0-SNAPSHOT.zip" | ||
ENV APPDIR="/openhab" | ||
|
||
# Add openhab user | ||
RUN adduser --disabled-password --gecos '' --home ${APPDIR} openhab &&\ | ||
adduser openhab sudo &&\ | ||
adduser openhab dialout &&\ | ||
echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers.d/openhab | ||
|
||
WORKDIR ${APPDIR} | ||
|
||
RUN \ | ||
wget -nv -O /tmp/openhab.zip ${DOWNLOAD_URL} &&\ | ||
unzip -q /tmp/openhab.zip -d ${APPDIR} &&\ | ||
rm /tmp/openhab.zip | ||
|
||
RUN mkdir -p ${APPDIR}/userdata/logs && touch ${APPDIR}/userdata/logs/openhab.log | ||
|
||
# Copy directories for host volumes | ||
RUN cp -a /openhab/userdata /openhab/userdata.dist && \ | ||
cp -a /openhab/conf /openhab/conf.dist | ||
COPY ./entrypoint.sh / | ||
ENTRYPOINT ["/entrypoint.sh"] | ||
|
||
RUN chown -R openhab:openhab ${APPDIR} | ||
USER openhab | ||
# Expose volume with configuration and userdata dir | ||
VOLUME ${APPDIR}/conf ${APPDIR}/userdata | ||
EXPOSE 8080 8443 5555 | ||
CMD server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/bin/bash -x | ||
set -e | ||
|
||
# Initialize empty host volumes | ||
if [ -z "$(ls -A "/openhab/userdata")" ]; then | ||
# Copy userdata dir | ||
echo "No userdata found... initializing." | ||
sudo cp -av /openhab/userdata.dist/. /openhab/userdata/ | ||
fi | ||
|
||
if [ -z "$(ls -A "/openhab/conf")" ]; then | ||
# Copy userdata dir | ||
echo "No configuration found... initializing." | ||
sudo cp -av /openhab/conf.dist/. /openhab/conf/ | ||
fi | ||
|
||
# Prettier interface | ||
if [ "$1" = 'server' ] || [ "$1" = 'openhab' ]; then | ||
eval /openhab/start.sh | ||
elif [ "$1" = 'debug' ]; then | ||
eval /openhab/start_debug.sh | ||
else | ||
exec "$@" | ||
fi | ||
|