Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mount denied - Path /etc/localtime is not shared from OS X and is not known to Docker #44

Open
ChaiBapchya opened this issue Jun 14, 2018 · 3 comments

Comments

@ChaiBapchya
Copy link

ChaiBapchya commented Jun 14, 2018

MAC OS version - Sierra 10.12.6 (16G1408)
Docker version - 18.03.0-ce, build 0520e24

Reproduce this error as

$ docker-compose up -d
Starting c1b9c5a1c9d4_netstats ... error

ERROR: for c1b9c5a1c9d4_netstats  Cannot start service netstats: b'Mounts denied: \r\nThe path /etc/localtime\r\nis not shared from OS X and is not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'

ERROR: for netstats  Cannot start service netstats: b'Mounts denied: \r\nThe path /etc/localtime\r\nis not shared from OS X and is not known to Docker.\r\nYou can configure shared paths from Docker -> Preferences... -> File Sharing.\r\nSee https://docs.docker.com/docker-for-mac/osxfs/#namespaces for more info.\r\n.'
ERROR: Encountered errors while bringing up the project.
ChaiBapchya added a commit to ChaiBapchya/ethereum-docker that referenced this issue Jun 14, 2018
Fixes the issue of Mount denied - Path /etc/localtime is not shared from OS X and is not known to Docker.

One needs to create file /etc/timezone and add `America/New_york`
@ChaiBapchya
Copy link
Author

While trying docker-compose up -d, got this error - Issue - docker/for-mac#2396
Solution that worked for me

$ mkdir ~/etc
$ vi ~/etc/timezone

Enter the timezone (mine was America/New_York)

Later updated the docker-compose.yml file with the following

  - ~/etc/timezone:/etc/localtime:ro
     # - /etc/localtime:/etc/localtime:ro #comment this

@Asone
Copy link

Asone commented Jun 17, 2018

I'm not even sure the localtime is necessary.

I had the same problem, tried many different solutions, even making a new ln -s to the localtime folder location until i commented out the volumes pointing out for localtime.

It seems to work on my machine.

Note that /etc/localtime itself is no more than a symlink to /private/etc/localtime on Mac OS .
Trying to attach directly to /private/etc/localtime brought me an error too though

@franz-josef-kaiser
Copy link

franz-josef-kaiser commented Feb 3, 2021

In case someone else running macOS 11 Big Sur stumbles upon this: Sharing the /private folder works (for me):

# docker-compose.yml
    volumes:
      - /private/etc/localtime:/etc/localtime:ro

The /private-resource was added in Docker 3.1 macOS desktop app preferences.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants