Somehow after a Docker image rebuild, I started having problems with javascript timezone problem. It used to work, but after a Docker image update, somehow the resulting Date object does not obey the TZ setting anymore. As the result, our timezone depending Date string formatting tests are failing.
# in the tests
console.log(new Date("2016-04-01T00:00:00.000000+00:00"));
// It is very strange it says (Asia) at the end.
// In fact, it will say whatever I put in TZ
Fri Apr 01 2016 00:00:00 GMT+0000 (Asia)
# in Chrome developer tool
console.log(new Date());
Fri Apr 01 2016 08:00:00 GMT+0800 (CST)
gulp.task('test', ['_set_tpe_timezone'], runKarmaWebpackTests);
gulp.task('_set_tpe_timezone', function() {
gutil.log('Setting timezone TZ = Asia/Taipei');
process.env.TZ = 'Asia/Taipei';
return;
});
I am using the following setup to run javascript tests:
process.env.TZ = 'Asia/Taipei';
cat /etc/timezone
= Etc/UTC
Although the root cause is not yet discovered, a solution was found. Since this problem did not appear before, but only after a docker system prune -a
, the base image was updated to the latest, which introduce this bug.
As a temporary solution, I have switch back to the old base image and it works like before without other modifications. I am going to also report this to the phusion team.
FROM phusion/baseimage
...
FROM phusion/baseimage:0.9.21
...
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.