Hello everyone, Happy New Year!
I noticed some quirkiness with time inside the singularity container.
When I run the date command inside the container, it would be 8 hours ahead. It is as if the timezone data has cancelled between the host and the container (I am at GMT-8).
Inside the singularity container TZ defaults to "PST".
If I set TZ to "America/Los_Angeles" then date reports correct time.
File time-stamp are similarly affected.
Oh, I remember there were some weird issue with "PST". Maybe folks at other timezone don't have this problem?
Below I have some command session that show more details of the issue.
Singularity: 2.2.1
Host: Ubuntu 14.04
Image: CentOS 6.8
sn@backbay:/opt/singularity_repo$ date
Tue Jan 3 15:49:08 PST 2017
sn@backbay:/opt/singularity_repo$ /opt/tmp/bin/singularity shell centos6.img
Singularity: Invoking an interactive shell within container...
Singularity.centos6.img> date
Tue Jan 3 23:49:11 PST 2017
Singularity.centos6.img> echo $TZ
PST
Singularity.centos6.img> export TZ="America/Los_Angeles"
Singularity.centos6.img> date
Tue Jan 3 15:49:44 PST 2017
Singularity.centos6.img> exit
sn@backbay:/opt/singularity_repo$ date; touch /tmp/time_test_host; ls -l /tmp/time_test*
Tue Jan 3 15:52:58 PST 2017
-rw-rw-r-- 1 sn sn 0 Jan 3 15:52 /tmp/time_test_host
sn@backbay:/opt/singularity_repo$ /opt/tmp/bin/singularity shell centos6.img
Singularity: Invoking an interactive shell within container...
Singularity.centos6.img>
Singularity.centos6.img> touch /tmp/time_test_container
Singularity.centos6.img> date; ls -l /tmp/time_test*
Tue Jan 3 23:54:05 PST 2017
-rw-rw-r-- 1 sn sn 0 Jan 3 23:54 /tmp/time_test_container
-rw-rw-r-- 1 sn sn 0 Jan 3 23:52 /tmp/time_test_host
Singularity.centos6.img> exit
exit
sn@backbay:/opt/singularity_repo$ ls -l /tmp/time_test*
-rw-rw-r-- 1 sn sn 0 Jan 3 15:54 /tmp/time_test_container
-rw-rw-r-- 1 sn sn 0 Jan 3 15:52 /tmp/time_test_host
sn@backbay:/opt/singularity_repo$