A web app container which listens on tcp/8080 and prints "Hello World".
Static compiled, no dynamic dependencies, no OS (distroless).
docker build -t hello-world .
docker run --rm -p 8080:8080 hello-world
The container will run and bind to port 8080
on localhost
.
In another terminal screen, do:
curl localhost:8080
Hello world!
docker image ls hello-world --format '{{ .Size }}'
4.19MB