Small Go app that shows the container's hostname in response of requests on port :8000. Useful on load balancing tests.
Code (git repo coming soon)
package main
import (
"io"
"net/http"
"os"
)
func main() {
hostName, err := os.Hostname()
if err != nil {
hostName = "<fail>"
}
http.HandleFunc("/", func(w http.ResponseWriter, req *http.Request) {
io.WriteString(w, hostName+"\n")
})
http.ListenAndServe(":8000", nil)
}
Content type
Image
Digest
Size
1.5 MB
Last updated
about 8 years ago
docker pull jcmoraisjr/whoami