The build time of Golang Docker images always frustrated me as there was always a need to do the go get ./... before we started building the binary. This resulted in fetching the dependencies every time we wanted to build the image. The Dockerfile then looked like this: FROM golang:alpine AS build-envCOPY . $GOPATH/src/mypackage/myapp/ WORKDIR $GOPATH/src/mypackage/myapp/# go get and build <-- THI
![Using go mod download to speed up Golang Docker builds](https://cdn-ak-scissors.b.st-hatena.com/image/square/6d6b9755101df85b1c3f322cab3e39af8a357d0f/height=288;version=1;width=512/https%3A%2F%2Fmiro.medium.com%2Fv2%2Fresize%3Afit%3A1200%2F1%2AQGQ628x_MPkc3VrlACCZHQ.jpeg)