Daemon exposing the output of any arbitrary command over HTTP.
Go 1.13
The commandd daemon allows basic configuration through flags. Comes with reasonable defaults.
$ ./commandd -help
Usage of ./commandd:
-addr string
Address to listen on (default ":8080")
-pattern string
Pattern to serve to (default "/run")
-timeout duration
Timeout for command (default 10s)
Anything after the flags is the command to execute on requesting pattern. A typical invocation looks like this:
$ ./commandd -addr=":8080" -timeout="2s" echo -n foo bar baz$ curl http://localhost:8080/run
foo bar bazRunning in Docker is easy. First, build an image.
docker build -t some-tag .To run a container from the freshly built image:
docker run -p 8080:8080 --rm -t some-tagThe -p flag publishes the container's port to the host.