From 6119e1e6608c1a97d5f43b228668f7ae3705556c Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Tue, 17 Feb 2015 00:56:35 -0800 Subject: [PATCH] Add a docker dev script --- scripts/dev_docker | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 scripts/dev_docker diff --git a/scripts/dev_docker b/scripts/dev_docker new file mode 100755 index 00000000000..52e839a270f --- /dev/null +++ b/scripts/dev_docker @@ -0,0 +1,28 @@ +# 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 \ + -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 \ + -t -i home-assistant-dev + +fi