2

I use docker to deploy a Java web application in tomcat. For testing purposes, I want to force the system date to a specific value.

With Docker it is not possible to change the container date without affecting the host date. So I would like to use Faketime. This tool allows to manipulate the system date for a given command. For example :

$ date
Web Jul 1 09:57:51 UTC 2015
$ faketime "2008-12-24" date
Web Dec 24 00:00:00 UTC 2008

Howewer when I use it starting tomcat, I got a sem_open error :

$ faketime "2008-12-24" /bin/bash -c "/opt/tomcat/bin/catalina.sh start"
[...]
Tomcat started.

$ tail -f /opt/tomcat/logs/catalina.out
sem_open: No such file or directory

Any idea to resolve this problem?

jsebfranck
  • 213
  • 1
  • 2
  • 7

1 Answers1

1

Not sure if you already resolved this problem,that I execute $ faketime "2016-11-02" /bin/bash -c "/opt/tomcat/bin/startup.sh start"

then it will fake the tomcat runtime date.Hope this useful.

Joie.C
  • 11
  • 2