-
Notifications
You must be signed in to change notification settings - Fork 214
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
Use multi-stage docker builds #247
base: new-features
Are you sure you want to change the base?
Use multi-stage docker builds #247
Conversation
c16e45d
to
d6cc7f5
Compare
Thanks for your contribution. 🎉 Let's discuss/resolve few comments that I've added before merging this. Also, could you provide the image size after multistage build? |
I don't see any comments of yours anywhere. Where did you add them? |
@smitpsanghavi Let me try creating a docker image with the modified dockerfile and compare the size on Dockerhub as well The comments are added as a code review which might be visible in the 'Files' section of this PR |
@smitpsanghavi I was not able to observe a significant reduction in size either on my end or on dockerhub repo after a push. Seems like dockerhub image size is increased after multistage. |
With regards to the reduction in size, I think something went wrong while building the image in your machine. I analysed your image and saw that when the command Here's a comparison: Your imageMy imageI would suggest checking why |
@smitpsanghavi Got it. I quickly cloned the updated docker file on my local for testing without creating any other files. Let me try building this branch itself. |
There is a substantial reduction in the size after a multistage build! Merging this change after running a functional test @smitpsanghavi |
I didn't expect a 50% reduction on Docker Hub! 😲 You can reduce this further if you remove any other unnecessary apt-get installations (e.g. git). I'll leave that to you. |
.dockerignore
file to ignore files not required within the final image.README.md