langgenius / dify-sandbox

A lightweight, fast, and secure code execution environment that supports multiple programming languages
https://docs.dify.ai/development/backend/sandbox
Apache License 2.0
341 stars 74 forks source link

how to change the default time zone #50

Closed lordk911 closed 1 week ago

lordk911 commented 2 weeks ago

when : image

it will use the default UTC timezone

when : image

will got error:operation not permitted

lordk911 commented 2 weeks ago

I deploy dify use k8s helm : https://github.com/douban/charts/tree/master/charts/dify

I've set the sandbox container env:

- name: TZ
      value: "Asia/Shanghai"

and go into the container:

image

But why In dify when exec code in python it still use UTC timezone

lordk911 commented 2 weeks ago

1、go into the containser anf exec : ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime , can work it out

Yeuoly commented 1 week ago

Thanks so much for reporting this, I have fixed it.