Skip to content
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

Simplify and speed up docker build #1084

Merged
merged 11 commits into from
Jul 22, 2019
Merged

Simplify and speed up docker build #1084

merged 11 commits into from
Jul 22, 2019

Conversation

imbstack
Copy link
Contributor

This simplifies our usage of docker somewhat by shelling out to the cli. While I was at it, I enabled buildkit.

Old Style

$ time docker build --no-cache .      
...
 ---> 348633f6652e                                           
Successfully built 348633f6652e        
docker build --no-cache .  24.17s user 2.71s system 5% cpu 8:55.36 total

Buildkit

time  DOCKER_BUILDKIT=1 docker build --no-cache . 
...
 => exporting to image                                                                                                                                                       15.5s
 => => exporting layers                                                                                                                                                      15.5s
 => => writing image sha256:850aafb7a9881a3883fb7bfc6df9d258f4a76a9378f854ba8d328fc6be0bdfb9                                                                                  0.0s
DOCKER_BUILDKIT=1 docker build --no-cache .  3.90s user 2.43s system 4% cpu 2:20.89 total

Unscientifically this is a ~6 minute speed up.

It seems to run just fine on my dev deployment.

@imbstack imbstack requested a review from a team as a code owner July 21, 2019 05:22
Copy link
Collaborator

@djmitche djmitche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. I'm not 100% clear on why it would be faster (did it maybe have to pull the node images in the first run?) but hey, it's not slower :)

@imbstack
Copy link
Contributor Author

It is kinda hidden but the speedup comes from setting DOCKER_BUILDKIT=1. I'm not sure what magic they've done with buildkit but it is waaay faster in my experience so far.

@imbstack imbstack merged commit 16570da into master Jul 22, 2019
@imbstack imbstack deleted the docker-build-goodness branch July 22, 2019 22:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants