forked from kubernetes/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request kubernetes#893 from derekwaynecarr/kubernetes_hell…
…o_world Add small image to use for e2e-testing and getting started examples
- Loading branch information
Showing
3 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FROM scratch | ||
ADD hello / | ||
EXPOSE 8080 | ||
ENTRYPOINT ["/hello"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |