I work on Windows 10. I use a docker image based on Ubuntu 18.04 (FROM ubuntu:18.04
). When I run a Linux container using Docker the time returned by "date
" command differs from the time on the Windows host machine. The time in the Linux container is two hours earlier than in the Windows host machine. Based on the research I have tried -v
option with docker run
command but it doesn't work (I run Docker commands from the powershell terminal or Windows cmd scripts, Docker Desktop by default uses Linux containers):
docker run -it --rm -v /etc/timezone:/etc/timezone:ro -v /etc/localtime:/etc/localtime:ro myimage bash
I'm looking for an "offline" solution. How to fix that ?