Skip to content

fix: optimize dockerfile to reduce build space usage#2

Open
TimPietrusky wants to merge 1 commit intomainfrom
fix/optimize-dockerfile
Open

fix: optimize dockerfile to reduce build space usage#2
TimPietrusky wants to merge 1 commit intomainfrom
fix/optimize-dockerfile

Conversation

@TimPietrusky
Copy link
Contributor

Motivation

  • Implemented multi-stage build to significantly reduce the final image size
  • Added aggressive cleanup after each build step to prevent disk space issues
  • Used shallow git clones for all repository dependencies
  • Split model downloads with cleanup between each to manage disk space
  • Optimized runtime image by only including necessary components
  • Updated documentation to reflect the changes and improvements

Technical Changes

  1. Dockerfile improvements:

    • Split build into builder and runtime stages
    • Consolidated RUN commands to reduce layers
    • Added cleanup after each major step
    • Used --no-install-recommends for apt-get
    • Implemented shallow git clones
    • Added staged model downloads with cleanup
  2. Documentation updates:

    • Added CHANGES.md to track optimizations
    • Updated README.md with current information

These changes should resolve the "no space left on device" error during builds while also producing a more optimized final image.

- Implement multi-stage build to reduce final image size
- Add aggressive cleanup after each build step
- Use shallow git clones for dependencies
- Split model downloads with cleanup between each
- Update documentation with changes
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.

1 participant