Fixed the container name (#8)
* Fixed the container name * whoamI -> whoami
This commit is contained in:
committed by
Emile Vauge
parent
c039b48727
commit
585d48ff07
2
.gitignore
vendored
2
.gitignore
vendored
@ -1 +1 @@
|
|||||||
/whoamI
|
/whoami
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
# Create a minimal container to run a Golang static binary
|
# Create a minimal container to run a Golang static binary
|
||||||
FROM scratch
|
FROM scratch
|
||||||
COPY whoamI /
|
COPY whoami /
|
||||||
ENTRYPOINT ["/whoamI"]
|
ENTRYPOINT ["/whoami"]
|
||||||
EXPOSE 80
|
EXPOSE 80
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
# whoamI
|
# whoami
|
||||||
|
|
||||||
Tiny Go webserver that prints os information and HTTP request to output
|
Tiny Go webserver that prints os information and HTTP request to output
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ docker run -d -P --name iamfoo emilevauge/whoami
|
$ docker run -d -P --name iamfoo containous/whoami
|
||||||
$ docker inspect --format '{{ .NetworkSettings.Ports }}' iamfoo
|
$ docker inspect --format '{{ .NetworkSettings.Ports }}' iamfoo
|
||||||
map[80/tcp:[{0.0.0.0 32769}]]
|
map[80/tcp:[{0.0.0.0 32769}]]
|
||||||
$ curl "http://0.0.0.0:32769"
|
$ curl "http://0.0.0.0:32769"
|
||||||
|
4
app.go
4
app.go
@ -34,7 +34,7 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
http.HandleFunc("/echo", echoHandler)
|
http.HandleFunc("/echo", echoHandler)
|
||||||
http.HandleFunc("/bench", benchHandler)
|
http.HandleFunc("/bench", benchHandler)
|
||||||
http.HandleFunc("/", whoamI)
|
http.HandleFunc("/", whoami)
|
||||||
http.HandleFunc("/api", api)
|
http.HandleFunc("/api", api)
|
||||||
http.HandleFunc("/health", healthHandler)
|
http.HandleFunc("/health", healthHandler)
|
||||||
fmt.Println("Starting up on port " + port)
|
fmt.Println("Starting up on port " + port)
|
||||||
@ -75,7 +75,7 @@ func echoHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func whoamI(w http.ResponseWriter, req *http.Request) {
|
func whoami(w http.ResponseWriter, req *http.Request) {
|
||||||
u, _ := url.Parse(req.URL.String())
|
u, _ := url.Parse(req.URL.String())
|
||||||
queryParams := u.Query()
|
queryParams := u.Query()
|
||||||
wait := queryParams.Get("wait")
|
wait := queryParams.Get("wait")
|
||||||
|
Reference in New Issue
Block a user