Is there any way to set a Docker containers system time dynamically (at run time) without effecting the host machine?
Using
hwclock --set --date "Sat Aug 17 08:31:24 PDT 2016"
gives the following error:
hwclock: Cannot access the Hardware Clock via any known method.
hwclock: Use the --debug option to see the details of our search for an access method.
Using
date -s "2 OCT 2006 18:00:00"
gives the following error:
date: cannot set date: Operation not permitted
Use case:
I need to test time sensitive software (behaviour depends on the date).
Other common use cases:
- running legacy software with y2k bugs
- testing software for year-2038 compliance
- debugging time-related issues, such as expired SSL certificates
- running software which ceases to run outside a certain timeframe
- deterministic build processes.