From d3b93dd8b0868e55693de7890c26d92b3c605505 Mon Sep 17 00:00:00 2001 From: Qi Zheng Date: Tue, 5 Sep 2023 10:37:51 +0800 Subject: [PATCH] [readthedocs] Add QA for how to modify timezone in Occlum --- docs/readthedocs/docs/source/qa.md | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/docs/readthedocs/docs/source/qa.md b/docs/readthedocs/docs/source/qa.md index b090070e..38f75f99 100644 --- a/docs/readthedocs/docs/source/qa.md +++ b/docs/readthedocs/docs/source/qa.md @@ -45,3 +45,33 @@ Add below part in the bom file if required. - dirs: - /etc/ssl ``` + +### How to modify the default timezone in Occlum? + +In Occlum, default timezone is Coordinated Universal Time (UTC). Users could do below to modify the timezone accordingly. + +For example, **Asia/Shanghai** is expected timezone. +Put below in the bom file and do copy_bom again, then rebuild the occlum instance. + +* For glibc application: +``` + - target: /opt/occlum/glibc/etc + copy: + - files: + - name: /usr/share/zoneinfo/Asia/Shanghai + rename: localtime +``` + +* For musl-libc application: +``` + - target: /etc + copy: + - files: + - name: /usr/share/zoneinfo/Asia/Shanghai + rename: localtime +``` + +Above two could be verified by demo [bash](https://github.com/occlum/occlum/tree/master/demos/bash). Just adding above timezone parts into corresponding bom file, rebuild and try below command to make sure the timezone is as expected. +``` +occlum run /bin/busybox date +```