Skip to content

fix: docker timezone#161

Merged
1379 merged 1 commit into
go-sonic:masterfrom
jakezhu9:master
Mar 3, 2023
Merged

fix: docker timezone#161
1379 merged 1 commit into
go-sonic:masterfrom
jakezhu9:master

Conversation

@jakezhu9

Copy link
Copy Markdown
Member

fix #101

add tzdata in Dockerfile and set Asia/Shanghai as the default timezone

we can also change timezone by specifying the environment variables -e TZ=Asia/Shanghai

@1379

1379 commented Feb 18, 2023

Copy link
Copy Markdown
Contributor

Thansk! And sorry to see it so late.
There are several problems:

  1. The installation of tzdata should be in the builder stage
  2. If other time zones are specified through environment variables, can they take effect
  3. The default time zone should be more international

@jakezhu9

Copy link
Copy Markdown
Member Author

Thanks for review

  1. To support changing timezone by env, we should install tzdata in prod. This will provide us with all the necessary timezone data. They can take effect
  2. As many of users are Chinese and i18n still in the todo list, I think it't better to set the default timezone to Asia/Shanghai

@1379

1379 commented Feb 20, 2023

Copy link
Copy Markdown
Contributor

But you only copied the Asia/Shanghai time zone file to/etc/localtime. If specified other time zones through the environment variable, wouldn't the file be missing in/etc/localtime?

@jakezhu9

Copy link
Copy Markdown
Member Author

Both /etc/localtime and /etc/timezone are used to configure the current time zone of the system. Other files are stored in /usr/share/zoneinfo and will be read when specified.

I have tested it (here i use podman, the same to docker)
image

@jakezhu9

jakezhu9 commented Mar 3, 2023

Copy link
Copy Markdown
Member Author

@1379 any updates on this? let me know if you have any questions

@1379

1379 commented Mar 3, 2023

Copy link
Copy Markdown
Contributor

Sorry,I am too busy😭

@1379 1379 merged commit 777ae13 into go-sonic:master Mar 3, 2023
@1379

1379 commented Mar 3, 2023

Copy link
Copy Markdown
Contributor

Thanks

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