Change date inside container

Viewed 4739

I have problem with dynamically date change inside container. What I have:

docker run -it --privileged myDocker

the command above run container with privilege to change date

I can change date by:

date --set "12-12-12" 

but after a few seconds, the date and time are setted the same as the host

root@660acd776c6b:/# date --set "12-12-12"
root@660acd776c6b:/# date
Wed Dec 12 00:00:01 UTC 2012
root@660acd776c6b:/# date
Wed Dec 12 00:00:02 UTC 2012
root@660acd776c6b:/# date
Wed Dec 12 00:00:02 UTC 2012
root@660acd776c6b:/# date
Tue Jan 15 10:14:26 UTC 2019
root@660acd776c6b:/# date
Tue Jan 15 10:14:27 UTC 2019

The container doesn't have installed ntp. I can't use faketime because I use the date in .net application which doesn't use time from faketime. I can't change system clock using faketime.

How could I disable synchronization between container and host ?

0 Answers
Related