ethereum-docker icon indicating copy to clipboard operation
ethereum-docker copied to clipboard

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

Open ChaiBapchya opened this issue 7 years ago • 3 comments
trafficstars

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 avatar Jun 14 '18 21:06 ChaiBapchya

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

ChaiBapchya avatar Jun 14 '18 22:06 ChaiBapchya

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

Asone avatar Jun 17 '18 07:06 Asone

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.

franz-josef-kaiser avatar Feb 03 '21 23:02 franz-josef-kaiser