Add multi-stage to the Dockerfile with Ubuntu as last stage without non-necessary dependencies (go, git, etc.) just having the dependencies required by libheif and go-avif and the final binary. Before the change the image size was 1.16 GB and now it is 520 MB.
Type of change
Please delete options that are not relevant.
[ ] Bug fix (non-breaking change which fixes an issue)
[x] New feature (non-breaking change which adds functionality)
[ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
[ ] This change requires a documentation update
How Has This Been Tested?
I built the image locally many times and used dive to dive deeper into the image file system to see potential improvements.
Checklist:
[x] My code follows the style guidelines of this project
[x] I have performed a self-review of my own code
[ ] I have commented my code, particularly in hard-to-understand areas
[ ] I have made corresponding changes to the documentation
[ ] I have added tests that prove my fix is effective or that my feature works
[ ] New and existing unit tests pass locally with my changes
[x] I have checked my code and corrected any misspellings
Optimize Container image size
Description
Add multi-stage to the Dockerfile with Ubuntu as last stage without non-necessary dependencies (go, git, etc.) just having the dependencies required by
libheif
andgo-avif
and the final binary. Before the change the image size was 1.16 GB and now it is 520 MB.Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I built the image locally many times and used dive to dive deeper into the image file system to see potential improvements.
Checklist: