This image contains pre-installed tools helpful for development purposes.
Also this image can be used as part of build process (lint, test, cover, etc.)
Create test package with purpose to check this docker image:
package main
func main() {
println("It works!")
}
Now you can run next command:
docker run -it --rm -v $PWD:/app -w /app cn007b/go go run main.go
And you can run next command to check that everything is ok:
docker run -it --rm -v $PWD:/app -w /app cn007b/go sh -c '
go vet
go fmt ./...
golint ./...
golangci-lint run
gosec -tests ./...
'
package main
import (
"net/http"
)
func main() {
http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("Hello world!"))
})
http.ListenAndServe(":8080", nil)
}
Now you can run next command:
docker run -it --rm -p 80:80 -v $PWD:/app -w /app cn007b/go sh -c \
'gin --port 80 --appPort 8080 run main.go'
# and
curl localhost:80
With purpose to use google-app-enginee please use next commands:
docker run -it --rm cn007b/go:1.10-gae gcloud version
docker run -it --rm cn007b/go:1.10-gae goapp version
Content type
Image
Digest
sha256:3454246c9…
Size
128.6 MB
Last updated
almost 4 years ago
docker pull cn007b/go