Setting timedatectl on Docker with Linux OS



Follow these steps :

1. Jump into container

$ docker exec -u 0 -it container-id bash

2. Remove /etc/localtime

$ rm -rf /etc/localtime

3. Linked a new one

$ ln -s /usr/share/zoneinfo/Asia/Jakarta /etc/localtime

4. Now you can verify by execute one of them command

$ date

$ timedatectl status


Done


Source :

https://stackoverflow.com/questions/57607381/how-do-i-change-timezone-in-a-docker-container
https://www.tecmint.com/set-time-timezone-and-synchronize-time-using-timedatectl-command/

Comments