-
Notifications
You must be signed in to change notification settings - Fork 27.4k
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
docs: reduce image size in sample Dockerfile #24108
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you! Could you also update the corresponding with-docker
example?
Ah, great catch, didn't realise it'd be in example too. Thanks! I've updated the example to match updated documentation ✅ Edit: I've also updated the |
Running
chown
after COPYing the files in therunner
phase creates a new image layer, that has basically same size as the.next
directory.We can achieve the same result using the
--chown
argument ofCOPY
instruction. This time we don't create a duplicate layer.Additionally, we can save some space (approx. 1.5 MB) on the telemetry disable row by using the opt out env variable.
I believe this change will be most notable for sites generating a lot of pages statically (in my case, I have around 19k pages and this change saved me ~430 MB).