Merge pull request #893 from derekwaynecarr/kubernetes_hello_world

Add small image to use for e2e-testing and getting started examples
This commit is contained in:
brendandburns 2014-08-14 12:41:22 -07:00
commit ad8e853e82
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