Add smallest image possible to use for e2e-testing

This commit is contained in:
derekwaynecarr 2014-08-14 13:05:03 -04:00
parent e1998e5a07
commit 3fa4554e5f
3 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,4 @@
FROM scratch
ADD hello /
EXPOSE 8080
ENTRYPOINT ["/hello"]

View File

@ -0,0 +1,18 @@
package main
import (
"fmt"
"net/http"
)
func helloFromKubernetes(w http.ResponseWriter, r *http.Request) {
fmt.Fprintln(w, "Hello World! -- Kubernetes")
}
func main() {
http.HandleFunc("/", helloFromKubernetes)
err := http.ListenAndServe(":8080", nil)
if err != nil {
panic("ListenAndServe: " + err.Error())
}
}

View File

@ -0,0 +1,6 @@
#!/bin/bash
set -e
set -x
CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static" -s' hello.go