-
Notifications
You must be signed in to change notification settings - Fork 706
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve tiller-proxy build time with BuildKit #1342
Improve tiller-proxy build time with BuildKit #1342
Conversation
Notable changes: * BuildKit is used for `docker build`. * `COPY . .` is replaced with more explicit directives. * `--mount` flag preserves Go build cache between builds. * Removing the `-a` flag makes `go build` use Go build cache. This brought the build time (after modifying the source code) down from 20 seconds to about 5 seconds on my laptop. More info about BuildKit: https://docs.docker.com/develop/develop-images/build_enhancements
Thanks for the improvements @SimonAlling! Unfortunately, it seems that CircleCI doesn't have a version of docker new enough to support buildkit. Maybe you can move that to a variable? so in your local environment, you execute |
I could definitely do that, but it doesn't seem trivial. In particular, if I remove
However, judging from the CircleCI output, you're using Docker 18.09, which does support BuildKit:
So I'm a bit surprised that it doesn't work. |
Maybe it's something that needs to be enabled in the daemon? This is what I see in the CircleCI logs:
|
Yeah, I saw that as well. I'm not very familiar with CircleCI (and I don't have write access anyway); do you have time to try to find a solution? I think almost everyone working with Kubeapps would benefit from this PR. |
It seems it's possible to enable it from the comment here: https://ideas.circleci.com/ideas/CCI-I-1003 Can you replace in
That should work 🤞 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great, thanks!
Description of the change
docker build
.COPY . .
is replaced with more explicit directives.--mount
flag preserves Go build cache between builds.-a
flag makesgo build
use Go build cache.Benefits
This brought the build time (after modifying the source code) down from 20 seconds to about 5 seconds on my laptop.
Possible drawbacks