Gopher image by [Renee French][rf], licensed under [Creative Commons 3.0 Attributions license][cc3-by].
Go is an open source programming language that makes it easy to build simple, reliable, and efficient software.
package main
import (
"fmt"
"net/http"
)
func main() {
http.HandleFunc("/", HolaServidor)
http.ListenAndServe(":8080", nil)
}
func HolaServidor(w http.ResponseWriter, r *http.Request) {
fmt.Fprintf(w, "Memo Docker")
}
-
To download it, visit here
-
To run it locally, run
$ go run src/main.go
in the current directory -
To run it in docker
- Is needed to build it,
docket build -t go-app
- Is needed to run the docker image with
docker run --name go-container -p 8080:8080 go-app