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

修复docker-compose部署时时区设置不生效的问题 #101

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

zhangfugui727
Copy link

@zhangfugui727 zhangfugui727 commented Jan 14, 2022

在docker-compose部署中,- 'TZ="Asia/Shanghai"'导致时区设置不生效,开始我以为是docker-compose的原因,安装了新版docker-compose,发现依然存在该问题,查看官方文档并调整后,能够设置成功

  • 已经过date -R命令测试

更改示例

更改前

version: '3'
services:
  mall-admin:
    image: mall/mall-admin:1.0-SNAPSHOT
    container_name: mall-admin
    environment:
      - 'TZ="Asia/Shanghai"'

更改后

version: '3'
services:
  mall-admin:
    image: mall/mall-admin:1.0-SNAPSHOT
    container_name: mall-admin
    environment:
      - TZ=Asia/Shanghai

文档资料

https://docs.docker.com/compose/compose-file/compose-file-v3/#environment

测试环境

  • docker版本
[root@xyzh-it-framework-test01 app]# docker version
Client: Docker Engine - Community
 Version:           20.10.12
 API version:       1.41
 Go version:        go1.16.12
 Git commit:        e91ed57
 Built:             Mon Dec 13 11:45:41 2021
 OS/Arch:           linux/amd64
 Context:           default
 Experimental:      true

Server: Docker Engine - Community
 Engine:
  Version:          20.10.12
  API version:      1.41 (minimum version 1.12)
  Go version:       go1.16.12
  Git commit:       459d0df
  Built:            Mon Dec 13 11:44:05 2021
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          1.4.12
  GitCommit:        7b11cfaabd73bb80907dd23182b9347b4245eb5d
 runc:
  Version:          1.0.2
  GitCommit:        v1.0.2-0-g52b36a2
 docker-init:
  Version:          0.19.0
  GitCommit:        de40ad0
  • docker-compose版本
[root@xyzh-it-framework-test01 app]# docker-compose version
docker-compose version 1.29.2, build 5becea4c
docker-py version: 5.0.0
CPython version: 3.7.10
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

@BlueLeer
Copy link

BlueLeer commented Jan 14, 2022 via email

@zhangfugui727
Copy link
Author

另外mall文档里也需要修改,辛苦作者了,感谢您的无私奉献,谢谢

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