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

Set Timezone of Docker Container to the Host's Local Time #1384

Closed
eggroll-bot opened this issue Nov 13, 2018 · 8 comments
Closed

Set Timezone of Docker Container to the Host's Local Time #1384

eggroll-bot opened this issue Nov 13, 2018 · 8 comments

Comments

@eggroll-bot
Copy link

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Yes. The timezone in Docker containers is always UTC and does not match the host machine's local time.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Please set the docker containers' time zones to the machine's local time when creating them.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

None.

Additional context
Add any other context or screenshots about the feature request here.

None.

@parkervcp
Copy link
Member

@eggroll-bot
Copy link
Author

/etc/timezone is a text file which is set to America/Los_Angeles, but the time is wrong when checking logs and in the console. It is 2:22 PM right now PST, however, the time displayed in the console is UTC. A screenshot on Imgur in a link below.

https://imgur.com/a/7a99yGQ

@DaneEveritt
Copy link
Member

Did you rebuild and restart that server container after making changes?

@eggroll-bot
Copy link
Author

I never made any changes, but just in case, what are the commands to rebuild the containers?

@DaneEveritt
Copy link
Member

Theres a button in the admin CP that will rebuild a server container. Once that is done you need to restart the server. Feel free to re-open this issue if that doesn't resolve the problem.

@kgns
Copy link
Contributor

kgns commented Nov 14, 2018

try with adding "timezone_path": "/etc/localtime" to your core.json config file if you are using Ubuntu.

/srv/daemon/config/core.json:

  "docker": {
    "socket": "/var/run/docker.sock",
    "autoupdate_images": true,
    "timezone_path": "/etc/localtime",   <----- add this line
  },

@eggroll-bot
Copy link
Author

Rebuilding the server container as @DaneEveritt suggested did not work, however, what @kaganus suggested worked.

Thanks, @kaganus.

@kgns
Copy link
Contributor

kgns commented Nov 15, 2018

no worries

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

4 participants