Fake Time in Docker

What if you need a container to have a different time than its host? Well, LD_PRELOAD has a solution for you. While this solution generally works outside of Docker, I rarely find myself outside of a container these days. I like that it works in one without requiring special privileges.

Dockerfile:

FROM ubuntu:latest

RUN apt-get update --fix-missing
RUN DEBIAN_FRONTEND=noninteractive apt-get install git build-essential -y
RUN git clone https://github.com/wolfcw/libfaketime.git
WORKDIR /libfaketime/src
RUN make install
RUN echo "/usr/local/lib/faketime/libfaketime.so.1" > /etc/ld.so.preload

ENTRYPOINT bash

Build with:

docker build -t faketime .

Run with:

docker run -ti --rm -e FAKETIME="1970-01-01 00:00:00" --name faketime faketime

Of course you can run the “date” command to confirm, but this fake time percolates to all processes in the container. I was reminded of the existence of LD_PRELOAD to hijack system calls recently, and remembered this old trick I had stashed in my notes.

And just in case it goes away, I mirrored the excellent repo this is based on here.

Oldie but Goodie

Since I figured out how to emulate old Dos games to host Capture the Flag using JSDos, I might as well spread further other games which left an impression in their time. I don’t mean to compete with the highly curated abandonware sites out there, I just want to reduce the chances for attrition by hosting another copy, and I like having these gems at my fingertips too.

Introducing MadTV, an addictive game where one runs programming for a TV channel. The issue? You’re also trying to “get the girl”, and she only likes utterly boring documentaries which aren’t good for ratings.

Click to pop out

Flipper Zero

I finally got my hands on a Flipper Zero and boy oh boy, let me tell you, I should have done this a long time ago. I got it for my own interests because I was curious to understand some protocols better. To my surprise, both kids have been way into it. I’m of course elated to titillate their hacker spirit. I didn’t even think it possible with a 7 year old, but the cross between ease of use, and yes… a Tamagochi is really hitting home. Esther’s mind was blown when she scanned and replayed the IR signals of a toy of hers.

Robin & I are trying to sniff and replay all kinds of signals which always leads to a deeper understanding of technology for the both of us.

I too I’m in love the with the fun packaging and the geek humor. There isn’t anything revolutionary about the capabilities, but they way lowered the bar of entry. Most of all, it’s built with a spirit that strongly appeals to my original love of computers. This little wonder sparks curiosity and discovery everywhere it goes.