I'm trying to make docker build faster for software that are built with golang
tried to cache layer but it still slow when dependency changed since go mod download have to redownload whole dependency again and again.
how to make use vendor directory on docker build? (where to copy? so go build or go mod download/go mod vendor inside Dockerfile so it doesn't redownload agian and again)?
I've tried to copy whole vendor, but it still redownloading
tried to copy vendor to $GOPATH/pkg/mod, but it also still redownloading
tried to copy vendor to $GOPATH/pkg/mod/cache/download, but it still redownloading
where the correct way to put vendor directory?