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

Reduce size of Docker image #278

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

sebp
Copy link
Contributor

@sebp sebp commented May 17, 2023

Using multi-stage build avoids that development and intermediate files increase the image's size. Multi-stage build allows just copying the compiled files to the final image without the intermediate layers.

Reduces the image's size from 8.99GB to 7.47GB.

Note: I haven't extensively tested whether the new image breaks something yet.

If there's a need, I can update the pytorch Dockerfile too.

Use multi-stage build to avoids having development and intermediate files increase the images size. Multi-stage build allows just copying the compiled files to the final image without the intermediate layers. Reduces the image's size by about 1.5GB.
@jamesdolezal
Copy link
Collaborator

Thanks for the PR - this seems like a good idea. I'll run some tests to ensure nothing breaks, and if all is good, we should do this for the PyTorch dockerfile too.

@jamesdolezal
Copy link
Collaborator

Just a quick update - I did have some issues with this multi-stage approach during initial testing, which is why I haven't been able to merge quite yet. I'll keep working on it and provide an update once I have a solution.

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.

2 participants