Skip to content

Commit

Permalink
[./dev_docker] fix TZ issue for docker on mac (#261)
Browse files Browse the repository at this point in the history
When TZ is not explicitly specified, docker on mac throws up this nice error by default:
```
docker: Error response from daemon: Mounts denied:
The path /etc/localtime
is not shared from OS X and is not known to Docker.
You can configure shared paths from Docker -> Preferences... -> File Sharing.
See https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.
```
Refer this upstream docker for-mac upstream issue for details: docker/for-mac#2396
This tiny improvement makes onboarding easier for mac folks who don't want to install libcoap maybe?
  • Loading branch information
xgt001 authored and ggravlingen committed Jan 2, 2020
1 parent 3f84552 commit 7425056
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions script/dev_docker
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,15 @@ then
-v `pwd`:/usr/src/app \
--rm \
-t -i tradfri-dev bash
elif [ "$(uname)" = "Darwin" ] && [ $# -eq 0 ]
then
OSX_TZ=$(ls -la /etc/localtime | cut -d/ -f8-9)
docker run \
--net=host \
-e "TZ=$OSX_TZ" \
-v `pwd`:/usr/src/app \
--rm \
-t -i tradfri-dev bash
else
docker run \
--net=host \
Expand Down

0 comments on commit 7425056

Please sign in to comment.