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 point fix using /etc/localtime file creation and pointing to it #45

Closed
wants to merge 3 commits into from

Conversation

ChaiBapchya
Copy link

@ChaiBapchya ChaiBapchya commented Jun 14, 2018

Fixes the issue #44 of Mount denied - Path /etc/localtime is not shared from OS X and is not known to Docker.

Similar to 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

Hence this pull request.

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 ChaiBapchya changed the title Fixes #44 Mount point fix using /etc/localtime file creation and pointing to it Jun 14, 2018
@Asone
Copy link

Asone commented Jul 5, 2018

Hi @ChaiBapchya, i believe this PR is on the right path, however adding a way to automate the file creation could make it a bit more complete.

My current guess is that we can use bash to achieve that :

sudo mkdir -p ~/etc && touch ~/etc/localtime | /usr/sbin/systemsetup -gettimezone | sed 's/^Time Zone\: //' > ~/etc/localtime

  • It builds the ~/etc/localtime file path
  • systemsetup allows us to retrieve the used timezone
  • sed cleans the unnecessary text
  • > ~/etc/localtime to store timezone in the file

Adding it in a dockefile could make it.

You'll also note that the command is using sudo as systemsetup requires root access to return the data.

EDIT : after a small research systemsetup seems to be specific to mac os. The instruction might need to be conditioned to mac os environment. If i have time to find how to do that i'll share it here.

Added command to automate process of creating /etc/localtime file and adding the Time Zone information
Added command to automate process of creating /etc/localtime file and adding the Time Zone information
@ChaiBapchya
Copy link
Author

@Asone does this pull request work now?

@ChaiBapchya ChaiBapchya deleted the patch-1 branch June 15, 2021 10:10
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

Successfully merging this pull request may close these issues.

2 participants