# Dockerfile is in the current folder
$ docker build . -t php-faketime
$ docker run --rm -e FAKETIME=+15d php-faketime php -r"var_dump(date('c'));"
string(25) "2021-10-30T10:34:11+00:00"
Created
October 15, 2021 10:35
-
-
Save dkarlovi/adfb0bf059948e552b8ca2a8ae65055b to your computer and use it in GitHub Desktop.
Example of using libfaketime with PHP in Docker
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM php:8.0-alpine | |
COPY --from=trajano/alpine-libfaketime /faketime.so /lib/faketime.so | |
ENV LD_PRELOAD=/lib/faketime.so |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment