Sign inSign up

sydalsitc/timetraveller

By sydalsitc

Updated 12 months ago

Java based web app showing the time inside a pod, for testing when shifting container through time.

Image
Integration & delivery
Developer tools
Web servers
0

257

sydalsitc/timetraveller repository overview

timetraveller

Simple web server that just specifies the system time for time travel tests

About

For a project where we shift containers through time a simple web server was needed to do basic tests. It just needs to display the "system time" inside the container. So I decided to write a small Java based web server for this task which displays the time inside the container in different human and machine readable formats.

We're using libfaketime to modify the system time inside the container. For testing purposes, here it gets installed right away into the webapp image. If you'd like to move any app or container in time in a kubernetes/openshift environment, without modification of the image, then feel free to contact me at sydals.itc(at)gmail.com.

Source code

This source of the project is to be found at https://github.com/SydalsITC/timetraveller.

Run

To run a copy of the webapp, simply use the following command:

docker run --rm -itd --name drwho -p 8080:8080 sydalsitc/timetraveller:1.0

There's a docker-compose.yml, too, for easy start and daemonizing:

docker-compose up -d

When up and running, the webserver is available at http://localhost:8080/ .

Contexts

The webapp is intended for developing and debugging purposes. Therefor it displays the time inside the container as well as some environment variables for libfaketime in different, easy or machine readable format. There's no fancy, shiny look, just timeless content. :-)

  • /about - shows some brief information about the webapp.
  • /now - displays the time inside the container in human readable format; basically, it's just the result of Instant.now(), e.g. 2025-09-20T04:06:22.035107349Z.
  • /epoch - the same, as seconds since 1970-01-01.
  • /uptime shows the uptime of the container/pod in seconds.
  • /FAKETIME and /LD_PRELOAD show the content of the respective environment variable.
  • /diff/ shows the difference between the given number of seconds since 1970-01-01 as long int and the respective value inside the container. Means /diff/0 shows the time inside the container in seconds since Unix start.
  • Under /time you'll find the internal time in different formats, both as epoch and human readable, plus the content of the variables FAKETIME and LD_PRELOAD:
    • /time/text : in plain text, key=value format, like for Unix env=value.
    • /time/json : as json record
    • /time/yaml : as yaml document
    • /time/csv : as csv file with column headers in line 1

Example:

{
  "uptime": 214,
  "epoch": 1759616006,
  "now": "2025-10-04T22:13:26.474068134Z",
  "FAKETIME": "+7d",
  "LD_PRELOAD": "/usr/lib/x86_64-linux-gnu/faketime/libfaketime.so.1"
}

Tag summary

Content type

Image

Digest

sha256:a50d0c14c

Size

280.1 MB

Last updated

12 months ago

docker pull sydalsitc/timetraveller