golang.org/x/build/cmd/gitlock
The gitlock command helps write Dockerfiles with a bunch of lines to lock git dependencies in place.