Public Repository

Last pushed: 2 years ago
Short Description
A mostly borken speechless clock.
Full Description

This fine piece of engineering may or may not give you the time it was a moment ago towards the past. Unless called before the time expected in return. Or after the delay unavoidable once the inherent foward-latency has been elapsing.

Details of architectural design

The brains, heart and guts of this container reside in /fido.rb:

require 'gserver'

# A server that returns the time in seconds since 1970.
class TimeServer < GServer

  def initialize(port=10001, host="", *args)
    super(port, host, *args)

  def serve(io)
    red = io.readline
    puts red
    io.print red


# Run the server with logging enabled (it's a separate thread).
server =

First, do note that it is clever enough to bind to all network interfaces ( and not just localhost as you could expect. This is to allow you to query it from the outside of the container. Even from beyond the outside. Handy, huh !?

Putting it to service

docker run -d -P ameuret/clock:v1.6 ruby fido.rb

Witness the power

Check the port assigned to the internal server:

docker ps
ID     IMAGE           COMMAND       STATUS       PORTS
bc3346 ameuret/clock:v1.6 "ruby fido.rb"  Up 4 seconds>10001/tcp     

Query it !

curl localhost:49153/
GET / HTTP/1.1
2014-10-13 14:36:51 +0100
Docker Pull Command

Comments (2)
3 years ago


3 years ago

I found really creative that it replies using part of the question before venturing into stating the time