Docker Container: time/timezone wrong

I am in a running docker container with node and for some reason the timezones / the time of the host machine vs inside the docker container never line up:

root@foobar:~# node -e "console.log(new Date())"
>> Tue May 17 2016 15:12:43 GMT+0200 (CEST)
root@foobar:~# docker exec 9179105c0ff9 node -e "console.log(new Date())"
>> Tue May 17 2016 13:13:01 GMT+0000 (Europe)
root@foobar:~# cat /etc/timezone
>> Europe/Vienna
root@foobar:~# docker exec 9179105c0ff9 cat /etc/timezone
>> Europe/Vienna

So what I already did in my docker-start shell is script is the following:

  • docker-machine create error … VBoxManage: error: Unknown option: --synthcpu
  • Run docker from console
  • Docker official registry url
  • GitLab CE Docker SMTP
  • cannot connect on SQLserver with Docker on mac
  • How specify the size of a shared Docker volume?
  • docker run \
    ...
    -v /etc/localtime:/etc/localtime:ro \
    -v /etc/timezone:/etc/timezone:ro \
    -e "TZ=Europe/Vienna" \
    ...
    

    … but still, as you can see in the first codeblock, the time is still wrong! Any ideas on this? What am I missing?

    (fyi: I am running a meteor app deployed via mupx)

    UPDATE:

    After running date on the host and inside the container, there again is a difference of 2hrs. so for some reason the docker container just does not “apply” my timezone and it seems like the problem is not JS/node related, since dateis just a simple unix system cmd … what am I missing here?!

  • vagrant, docker, shared volume not ready on initial provisioning
  • connect robomongo to mongo instance running inside docker container
  • GitLab CE Docker SMTP
  • How do I define the name of image built with docker-compose
  • Using Docker for HPC with Sun Grid Engine
  • No such file or directory in docker build
  • One Solution collect form web for “Docker Container: time/timezone wrong”

    >> Tue May 17 2016 15:12:43 GMT+0200 (CEST)

    and

    >> Tue May 17 2016 13:13:01 GMT+0000 (Europe)

    are approximately the same time(around 18sec difference, because you didn’t ran the commands at the same time).
    Take a closer look, it’s around 3pm GMT+0200 and around 1pm GMT+0000.
    This is just a difference in output format, but the time is the same.
    If you execute .getTime() on the value of the new Date(), you will probably have the same values.
    This is probably due to differences in default output format in different node.js versions.

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.