Skip to content

docker: docker cannot access /etc/localtime on OS X #10287

@emmanuelsearch

Description

@emmanuelsearch

Description

build with Docker on OS X fails because on OS X, /etc/localtime cannot be accessed by Docker.

Steps to reproduce the issue

building HelloWorld with docker:

$ BUILD_IN_DOCKER=1 BOARD=samr21-xpro make -C examples/hello-world/ 
Warning: no PORT set!
Launching build container using image "riot/riotbuild:latest".
docker run --rm -t -u "$(id -u)" \
	    -v '/Users/emmanuel/Documents/work/CODING/RIOT:/data/riotbuild/riotbase' \
	    -v '/Users/emmanuel/Documents/work/CODING/RIOT/cpu:/data/riotbuild/riotcpu' \
	    -v '/Users/emmanuel/Documents/work/CODING/RIOT/boards:/data/riotbuild/riotboard' \
	    -v '/Users/emmanuel/Documents/work/CODING/RIOT/makefiles:/data/riotbuild/riotmake' \
	    -v '/Users/emmanuel/Documents/work/CODING/RIOT:/data/riotbuild/riotproject' \
	    -v /etc/localtime:/etc/localtime:ro \
	    -e 'RIOTBASE=/data/riotbuild/riotbase' \
	    -e 'CCACHE_BASEDIR=/data/riotbuild/riotbase' \
	    -e 'RIOTCPU=/data/riotbuild/riotcpu' \
	    -e 'RIOTBOARD=/data/riotbuild/riotboard' \
	    -e 'RIOTMAKE=/data/riotbuild/riotmake' \
	    -e 'RIOTPROJECT=/data/riotbuild/riotproject' \
	      \
	    -e 'BOARD=samr21-xpro' \
	    -w '/data/riotbuild/riotproject/examples/hello-world/' \
	    'riot/riotbuild:latest' make  
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.
.
ERRO[0000] error waiting for container: context canceled 
make: *** [..in-docker-container] Error 125

Expected results

Build succeeds.

Actual results

Build fails.

Versions

RIOT master, on OS X 10.14, with Docker 18.06.1-ce.

Metadata

Metadata

Assignees

Labels

Area: build systemArea: Build systemOS: Mac OS XHost OS: This PR/issue concerns usage of RIOT with Mac OS X as a host systemType: bugThe issue reports a bug / The PR fixes a bug (including spelling errors)

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions