diff --git a/.gitignore b/.gitignore index d3a357e..aec4ee9 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1 @@ -/whoamI +/whoami diff --git a/Dockerfile b/Dockerfile index b23c0a0..211eb10 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # Create a minimal container to run a Golang static binary FROM scratch -COPY whoamI / -ENTRYPOINT ["/whoamI"] +COPY whoami / +ENTRYPOINT ["/whoami"] EXPOSE 80 diff --git a/README.md b/README.md index 39a38da..5d90cb3 100644 --- a/README.md +++ b/README.md @@ -1,9 +1,9 @@ -# whoamI +# whoami Tiny Go webserver that prints os information and HTTP request to output ```sh -$ docker run -d -P --name iamfoo emilevauge/whoami +$ docker run -d -P --name iamfoo containous/whoami $ docker inspect --format '{{ .NetworkSettings.Ports }}' iamfoo map[80/tcp:[{0.0.0.0 32769}]] $ curl "http://0.0.0.0:32769" diff --git a/app.go b/app.go index 19d959d..3f21553 100644 --- a/app.go +++ b/app.go @@ -34,7 +34,7 @@ func main() { flag.Parse() http.HandleFunc("/echo", echoHandler) http.HandleFunc("/bench", benchHandler) - http.HandleFunc("/", whoamI) + http.HandleFunc("/", whoami) http.HandleFunc("/api", api) http.HandleFunc("/health", healthHandler) 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()) queryParams := u.Query() wait := queryParams.Get("wait") diff --git a/build.sh b/build.sh index 9c6599a..7ddf05f 100755 --- a/build.sh +++ b/build.sh @@ -1,3 +1,3 @@ #!/bin/sh -CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o whoamI -docker build -t emilevauge/whoami . +CGO_ENABLED=0 go build -a --installsuffix cgo --ldflags="-s" -o whoami +docker build -t containous/whoami .