Skip to content

Commit

Permalink
Add smallest image possible to use for e2e-testing
Browse files Browse the repository at this point in the history
  • Loading branch information
derekwaynecarr committed Aug 14, 2014
1 parent e1998e5 commit 3fa4554
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions build/hello-kubernetes/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FROM scratch
ADD hello /
EXPOSE 8080
ENTRYPOINT ["/hello"]
18 changes: 18 additions & 0 deletions build/hello-kubernetes/hello.go
Original file line number Diff line number Diff line change
@@ -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())
}
}
6 changes: 6 additions & 0 deletions build/hello-kubernetes/prepare.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/bin/bash

set -e
set -x

CGO_ENABLED=0 go build -a -ldflags '-extldflags "-static" -s' hello.go

0 comments on commit 3fa4554

Please sign in to comment.