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

Remove node_modules from the final image #51445

Merged

Conversation

shouichi
Copy link
Contributor

No description provided.

@rails-bot rails-bot bot added the railties label Mar 29, 2024
@byroot
Copy link
Member

byroot commented Apr 17, 2024

I think not including the source is a good practice, but the RUN here is in its own layer, so this making the image any smaller.

@shouichi
Copy link
Contributor Author

shouichi commented Apr 17, 2024

Thank you for the review. If I'm not mistaken, it does reduce the image size of the final image. Because node_modules is removed from the build image and node_module is prevented from copying (in COPY --from=build /rails /rails) in the final image.

@byroot
Copy link
Member

byroot commented Apr 17, 2024

Ah sorry, I missed that. Yeah, then the more logical thing would be to use --exclude flag in COPY, but it's relatively recent and might not be supported everywhere, so I guess it's OK.

@byroot byroot merged commit cb72a91 into rails:main Apr 17, 2024
4 checks passed
@shouichi shouichi deleted the remove-node-modules-from-the-final-image branch April 17, 2024 23:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants