https://github.com/philips/golang-vendor-dockerfile-with-cache
https://github.com/philips/golang-vendor-dockerfile-with-cache
Last synced: 10 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/philips/golang-vendor-dockerfile-with-cache
- Owner: philips
- Created: 2020-07-23T14:46:32.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-23T17:53:56.000Z (almost 6 years ago)
- Last Synced: 2025-04-14T03:42:58.575Z (about 1 year ago)
- Language: Dockerfile
- Size: 53.7 KB
- Stars: 6
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Go + vendor/ + cache
This is an attempt at a Go Dockerfile that caches as much as possible for fast builds. This came out of frustration trying to use https://skaffold.dev and sitting through buildtimes that felt like a C++ code base.
See the [Dockerfile](https://github.com/philips/golang-vendor-dockerfile-with-cache/blob/master/Dockerfile)!
**Prior Art**
- A [reddit thread](https://www.reddit.com/r/golang/comments/hj4n44/improved_docker_go_module_dependency_cache_for/) with a bunch of stuff but doesn't use vendor/
- [Go 1.10 discussion thread](https://stackoverflow.com/questions/50520103/speeding-up-go-builds-with-go-1-10-build-cache-in-docker-containers) that uses old style vendor hacks
- [Blog post](https://www.docker.com/blog/containerize-your-go-developer-environment-part-3/) on new `docker buildx` features that use the Go build cache as a volume but is experimental
- [go mod download](https://medium.com/@petomalina/using-go-mod-download-to-speed-up-golang-docker-builds-707591336888) to speed up builds is helpful but I prefer to vendor everything