2015-02-23 01:36:28 +00:00
|
|
|
# Build and run Home Assinstant in Docker
|
|
|
|
|
2015-02-17 08:56:35 +00:00
|
|
|
# Optional: pass in a timezone as first argument
|
|
|
|
# If not given will attempt to mount /etc/localtime
|
|
|
|
|
|
|
|
# If current pwd is scripts, go 1 up.
|
|
|
|
if [ ${PWD##*/} == "scripts" ]; then
|
|
|
|
cd ..
|
|
|
|
fi
|
|
|
|
|
|
|
|
docker build -t home-assistant-dev .
|
|
|
|
|
|
|
|
if [ $# -gt 0 ]
|
|
|
|
then
|
|
|
|
docker run \
|
|
|
|
--net=host \
|
2015-02-22 07:21:44 +00:00
|
|
|
--device=/dev/ttyUSB0:/zwaveusbstick:rwm \
|
2015-02-17 08:56:35 +00:00
|
|
|
-e "TZ=$1" \
|
|
|
|
-v `pwd`:/usr/src/app \
|
|
|
|
-v `pwd`/config:/config \
|
2015-02-23 01:36:28 +00:00
|
|
|
-t -i home-assistant-dev
|
2015-02-17 08:56:35 +00:00
|
|
|
|
|
|
|
else
|
|
|
|
docker run \
|
|
|
|
--net=host \
|
|
|
|
-v /etc/localtime:/etc/localtime:ro \
|
|
|
|
-v `pwd`:/usr/src/app \
|
|
|
|
-v `pwd`/config:/config \
|
|
|
|
-t -i home-assistant-dev
|
|
|
|
|
|
|
|
fi
|