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

feature/reduce docker image size using build stage #836

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

Conversation

unsync
Copy link

@unsync unsync commented Dec 20, 2024

Title:
By using a build stage and copying only the needed resources, we can reduce the image size from 1Gb to 137Mb (at least, on my local builds)

Warning:
If the code owner can double check if any other local resources are needed in the docker image, that would be nice.

@VisargD
Copy link
Collaborator

VisargD commented Dec 20, 2024

Hey @unsync - Is 1GB the compressed size that you are getting? The size of the latest image tag is 222 MB.

@unsync
Copy link
Author

unsync commented Dec 20, 2024

Hey @unsync - Is 1GB the compressed size that you are getting? The size of the latest image tag is 222 MB.

@VisargD uncompressed, checking the sizes locally.

Here is the diff from a bare repo :
Screenshot 2024-12-20 at 08 07 20

But, even we we put aside the size, i think using the build step + copying only the resources you need is a good practice, that can avoid ton include sensitive/unwanted/unneeded files in the docker image, wdyt ?

@unsync
Copy link
Author

unsync commented Dec 20, 2024

You did such a great job for the build that compresses all sources into a single file, i just felt it was a waste of resources not to go all the way and make the smallest docker image possible ;)

@VisargD
Copy link
Collaborator

VisargD commented Dec 20, 2024

Agree, I will run some tests on this. Thanks!

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