Tiny (1.18 MiB) web server w/debug page. Runs nweb on busybox
10K+
Tiny docker image providing a web-server test, which adds ONLY 18.5 kb on top of busybox.
busybox base, i.e. usable linux box w/toolsnweb http-webserver<SERVER>/nweb.logInspired by tutum/hello-world, however, instead of building on top of alpine and php, this uses a modified nweb by Nigel Griffith, built to run on busybox, adding only a 18.5 kB layer, for a grand total of 1.18 MiB, a 93.4% size reduction.
docker run -d -p 8190:80 swalog/tiny-hello
curl localhost:8190
curl localhost:8190/nweb.log
These are available through he container log output, as well as the endpoint at <yourservice>/nweb.log hosted by the container.
nweb by Nigel Griffith. See https://www.ibm.com/developerworks/systems/library/es-nweb/index.htmlbusybox, the minimal linux distronweb:.log files (useful for debugging)Hit <endpoint>/nweb.log to request it from server
Everything should be ready to build from the initial repostory clone, after initializing submodules:
git submodule init && git submodule update
Docker image is also automatically built on dockerhub: https://hub.docker.com/r/swalog/tiny-hello/
nweb webserverDockerfile handles building the webserver executable in a multi-build stage.
Additionally a pre-compiled version provided in server folder. Read on if you want to build it locally, on your own machine.
Run ./build-nweb.sh, this generates the compiled nweb server
This requires several tools:
musl-gcc (musl-tools package)strip (binutils package)sstrip (from elfkickers, website)upx (upx-ucl package)All of these binary size reduction methods have been copied from sseemayer/mini-helloworld-httpd. Thanks!
This hosts a static page with hostname information, as well as listing certain environment variables used by k8s matching regex ^(.*)_PORT_([0-9]*)_(TCP|UDP).
To mitigate this, a cron-job is installed that recreates the index.html once every minute. Takes order of 2ms to execute.
nweb to generate webpage at reqest timeContent type
Image
Digest
Size
751.4 kB
Last updated
about 8 years ago
docker pull swalog/tiny-hello