Sign inSign up

andy23512/faketime-machine

By andy23512

Updated over 8 years ago

An Ubuntu Docker image with pre-installed faketime.

Image
0

825

andy23512/faketime-machine repository overview

Quick reference

What is faketime?

Faketime is a CLI tool that can easily change the date and time of a single process or whole system. It's really helpful for testing the behavior of projects at different time.

For more information about faketime, please visit https://github.com/wolfcw/libfaketime.

How to use this image

Start a faketime-machine instance

Starting a faketime-machine instance is simple:

$ docker run --name some-faketime-machine -e FAKETIME=some-faketime-setting -d andy23512/faketime-machine

... where some-faketime-setting is the time setting you want to assign to your container, such as '2008-12-24 08:15:42' for a certain time or '-15d' for 15 days ago from now. You can more information about this config at official document of faketime.

... via docker stack deploy or docker-compose

Example docker-compose.yml for mysql:

version: '3.1'

services:

  faketime-machine:
    image: andy23512/faketime-machine
    environment:
      FAKETIME: -15d

Try in PWD

Run docker stack deploy faketime-machine (or docker-compose up).

Container shell access

The docker exec command allows you to run commands inside a Docker container. The following command line will give you a bash shell inside your faketime-machine container:

$ docker exec -it some-faketime-machine bash

And you can try to print out the time with:

$ date

License

GNU General Public License v2.0

Tag summary

Content type

Image

Digest

Size

161.7 MB

Last updated

over 8 years ago

docker pull andy23512/faketime-machine