Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I had to check what the Go docker image does.... It does NOTHING, it just builds and installs Go, why would you even need a container for this?


Either as a base for a development environment, or a disposable container to compile your go programs.

For example, compiling your program with a different version of Go can be done just by changing the tag on your compile command, and doesn't require that you have any development tools or compilers installed on your machine (except docker).


It's super useful to be able to build go binaries in a CI system. It provides the Go toolchain in a container so that you can just use it as a mini-executor. For instance, in Jenkins you can hook up the Jenkins master to a Kubernetes cluster and run your CI in a docker container. The Go docker container is great for this. I can run `go test ...` etc.

Also, when building a container with a Go binary, it's a great base to build from. You can use Docker Multistage Builds[1] to build your binary in the Go container, then copy it out into a minimal container all in the same Dockerfile.

[1]: https://docs.docker.com/develop/develop-images/multistage-bu...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: