-
Notifications
You must be signed in to change notification settings - Fork 1k
Add option to "go install" all dependencies for Docker build caching #1374
Comments
hi, welcome! i'll be clear up front and say that, sorry, but independent of that, though, i'm a bit confused about what your goal is, here - if i'm grokking the piped logic there correctly, then it appears you're trying to discover and well, some thoughts:
|
hi, thanks for the quick response! To explain myself a little better:
I looked through your three suggestion, and I don't think any of them will quite work:
I totally get that What if we added a command to Does that seem more reasonable? |
oooook, i think i understand better now 😄 🎉 this still isn't quite the right thing for however, for your immediate purposes at least, i'd really just recommend writing a little custom Go binary to do what you need. |
I've created a PR implementing the template output flag |
@darkowlzz That flag does almost what I need, but Could there be a |
Some context: I'm setting up a development workflow for Go-based services that will run on a Kubernetes cluster. I'm setting up a minikube-based dev environment using a setup like Draft (not just using Draft because of Azure/draft#432) where i watch for changes to the source files, and then re-build a docker container and run it on Minikube. I'm trying to minimize the time it takes to deploy a change.
I was able to cut the
docker build
time from about 15 seconds down to about 8 bygo install
ing my dependencies, and then adding my source files and compiling those, because it means that the dependencies don't need to be re-compiled during each build.My dockerfile looks something like this:
This works, but the bit where i'm using
rq
to parseGopkg.lock
is a pretty crazy hack. Would you be open to adding something likedep install-deps
ordep ensure -vendor-only -install
that wouldgo install
vendored dependencies? Or perhaps there's a simpler way of accomplishing what I'm trying to do, and we could update https://github.com/stephenafamo/dep/blob/master/docs/FAQ.md#how-do-i-use-dep-with-docker ?The text was updated successfully, but these errors were encountered: