Own homeassistant docker

This commit is contained in:
pvizeli 2017-03-21 11:50:06 +01:00
parent 1db4eea2e6
commit ee77c8539e
3 changed files with 38 additions and 4 deletions

View File

@ -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

View File

@ -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"

34
homeassistant/Dockerfile Normal file
View File

@ -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" ]