After many hours of struggling with getting my go application to build within the building of my docker image, I decided this information could be useful to others. The problem I experienced, and likely why you are reading this, is that in order to fetch go dependencies from a private repository you need to setup git credentials within the docker image build.
Here are some errors that I was seeing through my struggles:
# ERROR 1
go: email@example.com: unknown revision v1.0.0
go: error loading module…