-
Notifications
You must be signed in to change notification settings - Fork 590
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
chore: Linted Dockerfiles #12470
chore: Linted Dockerfiles #12470
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.
Thanks for your contribution! But there are some changes just merged. Can you resolve conflicts?
I've resolved the merge conflicts. I'm testing the builds on my laptop now and the pipeline is re-running. |
It took a couple of tweaks, but builds with the new image work on my laptop now, and all of the pipeline tests here are passing. LMK if you have any questions! |
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.
Others LGTM
docker/Dockerfile
Outdated
libsasl2-dev \ | ||
locales \ | ||
openjdk-11-jdk && \ | ||
rm -rf /var/lib/apt/lists/* && \ |
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.
My idea is we just apt-update
once in base
, and avoid apt-update
again in other stages, and finally delete it in the risingwave
stage. How do you think?
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.
I think it is fine as long as we don't mind having all of those other packages installed for all of the build targets.
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.
Oh, and you have to run update
each time because I'm cleaning out the results of the update at the end of each package install to avoid the linter complaining that we are leaving interim package build artifacts in the various build targets.
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.
Yes, I mean we don't clean here and maybe just ignore the lint.
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.
I'd really prefer to leave each build stage "clean" if possible. Adding a bunch of linter exceptions is do-able if you really hate this. Since folks may build the container to any stage, it is better to keep each stage independent and as clean as possible if we can.
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.
IMO this doesn't have any real benefits, except reducing a lint, and it hurts caching at the same time. Caching apt-update
can be quite helpful, e.g., #7734
Hi @rotten , thank you for your interest and contribution to RisingWave. |
You could also consider adding the hdfs customizations as a different build target in the same docker file since the two files are almost identical. |
I hereby agree to the terms of the RisingWave Labs, Inc. Contributor License Agreement.
What's changed and what's your intention?
This Pull Request updates the Dockerfile and Dockerfile.hdfs to pass "linting" via the hadolint Dockerfile linter.
The previous Dockerfiles had numerous issues with generally regarded "best practices" for Dockerfiles.
There is probably some optimization (of image size) and lockdown (for security issues) that can still be done, this sets the files on a solid footing for approaching that work.
Checklist
./risedev check
(or alias,./risedev c
)Documentation
Release note