-
Notifications
You must be signed in to change notification settings - Fork 459
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
Optimize Dockerfile #480
base: main
Are you sure you want to change the base?
Optimize Dockerfile #480
Conversation
Signed-off-by: ali ghorbani <[email protected]>
Signed-off-by: ali ghorbani <[email protected]>
Signed-off-by: ali ghorbani <[email protected]>
Signed-off-by: ali ghorbani <[email protected]>
@ghorbani-ali please merge from main branch |
Hi @KrzysztofPajak |
@ghorbani-ali you have conflicts, please resolve it |
Conflicts have been resolved. During my investigations, I realized that exactly after my changes, similar changes were made, apparently from your team. What was strange to me was that the changes were exactly the same as mine, with a slight difference in the name and type of implementation. Thank you for explaining the reason for this. |
@ghorbani-ali Have you tried running the GrandNode image with 8.0-alpine ? |
Yes. but only in the build stage, not in runtime stage. |
Change runtime image to alpine
@KrzysztofPajak |
Type: feature
Issue
We can use alpine base images to have secure and lightweight images.
This Dockerfile has many commands to build modules statically, and this increases image layers unnecessarily.
There is no need to use the restore command explicitly because it runs implicitly when using the build command.
Solution
Replace SDK base image with alpine to lightweight build stage image.
Use dynamic package build for simplicity and decrease docker image layers.
Remove unnecessary restore commands. According to the official documentation, it is mentioned that this command is executed implicitly by the build command.
Remove duplicates in directory creation.
Testing
By running this command, the image builds cleanly without using cache and shows all the debug information about what is happening.
docker build --no-cache --progress=plain -t grandnode2:latest .