root@4a86da47e271:/# cat /etc/timezone
Europe/Moscow
root@4a86da47e271:/# exit
exit
drno@work01:~$ cat /etc/timezone
Europe/Moscow
ENV TZ=Europe/Moscow
RUN apt-get install -y tzdata
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
FROM ubuntu
ENV TZ=Europe/Moscow
RUN apt-get update && apt-get install -yy tzdata
RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
$ docker build .
Sending build context to Docker daemon 2.048kB
Step 1/4 : FROM ubuntu
---> d70eaf7277ea
Step 2/4 : ENV TZ=Europe/Moscow
---> Using cache
---> 24c7e693dacf
Step 3/4 : RUN apt-get update && apt-get install -yy tzdata
---> Using cache
---> 8d1bbd58900b
Step 4/4 : RUN cp /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
---> Using cache
---> b65965107725
Successfully built b65965107725
$ docker run b65965107725 date
Thu Oct 29 21:09:13 MSK 2020
$ date
Thu Oct 29 21:09:15 MSK 2020