Developing Go apps with Docker
summary
Shows how to Dockerize a Go HTTP server (Go 1.18.1) by copying go.mod, running go mod download, building with go build -o codedocker, and running the binary in a container exposing host port mapping 8081 → 8080; demonstrates caching/layering pitfalls so dependency steps don’t rerun on code changes. Replaces bulky golang:buster build image with an alpine final stage via a multi-stage Dockerfile, cutting the initial ~913 MB image down to a much smaller runtime image; the container runs successfully.
AI-written summary · about
chapters (12)
- 0:00Start
- 4:35Create a Docker File
- 5:31Base Image
- 9:11Build the App
- 11:48Build this Docker File
- 15:40Best Practices
- 16:41Additional Dependencies
- 19:04Create a Build for Our Docker File
- 24:57Multi-Stage Pattern
- 25:39Multi-Stage Pattern in Docker
- 25:59Multi-Stage Builds
- 28:20Adding some Environment Variables for Go
related talks
01h 03mGo Microservices in Containers
30mUltimate Guide to Golang Development for Beginners
15m"ko: The Only Good Way to Build Go Containers"
46mSimplifying Scalable Cloud Application Development with Go
26mWrite Once, Compile Lots, Run Anywhere
13mThe Docker Trail
04mJoan López de la Franca Beltran - Dockerization of Go
01h 06mgolang rocks!
