From ee77c8539e4b59f4cef33d134a10ace61b9efc76 Mon Sep 17 00:00:00 2001 From: pvizeli Date: Tue, 21 Mar 2017 11:50:06 +0100 Subject: [PATCH] Own homeassistant docker --- .../create_hassio_supervisor.sh | 1 - .../homeassistant/create_homeassistant.sh | 7 ++-- homeassistant/Dockerfile | 34 +++++++++++++++++++ 3 files changed, 38 insertions(+), 4 deletions(-) create mode 100644 homeassistant/Dockerfile diff --git a/build-scripts/hassio-supervisor/create_hassio_supervisor.sh b/build-scripts/hassio-supervisor/create_hassio_supervisor.sh index f2366f914..6dde0c208 100755 --- a/build-scripts/hassio-supervisor/create_hassio_supervisor.sh +++ b/build-scripts/hassio-supervisor/create_hassio_supervisor.sh @@ -47,7 +47,6 @@ echo "[INFO] Setup docker for supervisor" mkdir -p $BUILD_DIR mkdir -p $WORKSPACE - cp ../../supervisor/Dockerfile $WORKSPACE/Dockerfile sed -i "s/%%BASE_IMAGE%%/${BASE_IMAGE}/g" $WORKSPACE/Dockerfile sed -i "s/%%SUPERVISOR_TAG%%/${DOCKER_TAG}/g" $WORKSPACE/Dockerfile diff --git a/build-scripts/homeassistant/create_homeassistant.sh b/build-scripts/homeassistant/create_homeassistant.sh index a0eb712d8..83982939d 100644 --- a/build-scripts/homeassistant/create_homeassistant.sh +++ b/build-scripts/homeassistant/create_homeassistant.sh @@ -42,12 +42,13 @@ WORKSPACE=${BUILD_DIR:=$SCRIPTPATH}/hass # setup docker echo "[INFO] Setup docker for homeassistant" mkdir -p $BUILD_DIR +mkdir -p $WORKSPACE echo "[INFO] load homeassistant" -cd $BUILD_DIR && git clone https://github.com/home-assistant/home-assistant hass -cd hass && git checkout $HASS_VERS +cp ../../homeassistant/Dockerfile $WORKSPACE/Dockerfile -sed -i "s/FROM.*/${BASE_IMAGE}/g" Dockerfile +sed -i "s/%%BASE_IMAGE%%/${BASE_IMAGE}/g" $WORKSPACE/Dockerfile +sed -i "s/%%HASS_VERSION%%/${HASS_VERS}/g" $WORKSPACE/Dockerfile # Run build echo "[INFO] start docker build" diff --git a/homeassistant/Dockerfile b/homeassistant/Dockerfile new file mode 100644 index 000000000..febd30c2e --- /dev/null +++ b/homeassistant/Dockerfile @@ -0,0 +1,34 @@ +FROM %%BASE_IMAGE%% + +# Add version +ENV VERSION %%HASS_VERSION%% + +# install core packages +RUN apk --no-cache add libuv git linux-headers eudev-dev libusb-dev + +# install component packages +RUN apk --no-cache add ffmpeg nmap net-tools + +## +# install zwave +WORKDIR /usr/src/ +RUN pip3 install --no-cache-dir cython==0.25.2 + +WORKDIR /usr/src/python-openzwave/ +RUN git clone https://github.com/OpenZWave/python-openzwave \ + && cd python-openzwave + && git checkout v0.3.2 \ + && make build \ + && make install \ + && mkdir -p /usr/local/share/python-openzwave + && cp -R openzwave/config /usr/local/share/python-openzwave/config + && rm -rf /usr/src/python-openzwave + +## +# install pip module for components + +# install home-assistant +RUN pip3 install --no-cache-dir uvloop homeassistant==%%HASS_VERSION%% + +# Run hass +CMD [ "python", "-m", "homeassistant", "--config", "/config" ]