1
mirror of https://github.com/home-assistant/core synced 2024-09-15 17:29:45 +02:00
ha-core/script/dev_docker
2017-04-21 23:32:51 -07:00

34 lines
670 B
Bash
Executable File

#!/bin/sh
# Build and run Home Assinstant in Docker.
# Optional: pass in a timezone as first argument
# If not given will attempt to mount /etc/localtime
# Stop on errors
set -e
cd "$(dirname "$0")/.."
docker build -t home-assistant-dev -f virtualization/Docker/Dockerfile.dev .
if [ $# -gt 0 ]
then
docker run \
--net=host \
--device=/dev/ttyUSB0:/zwaveusbstick:rwm \
-e "TZ=$1" \
-v `pwd`:/usr/src/app \
-v `pwd`/config:/config \
-t -i home-assistant-dev
else
docker run \
--net=host \
-v /etc/localtime:/etc/localtime:ro \
-v `pwd`:/usr/src/app \
-v `pwd`/config:/config \
--rm \
-t -i home-assistant-dev
fi