-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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
[DO_NOT_MERGE][INFRA] test dockerfile #41918
Conversation
@@ -55,10 +55,9 @@ RUN $APT_INSTALL r-base libcurl4-openssl-dev qpdf libssl-dev zlib1g-dev | |||
RUN Rscript -e "install.packages(c('knitr', 'markdown', 'rmarkdown', 'testthat', 'devtools', 'e1071', 'survival', 'arrow', 'roxygen2', 'xml2'), repos='https://cloud.r-project.org/')" | |||
|
|||
# See more in SPARK-39959, roxygen2 < 7.2.1 | |||
RUN apt-get install -y libcurl4-openssl-dev libgit2-dev libssl-dev libxml2-dev \ | |||
RUN apt-get install -y libgit2-dev libssl-dev libxml2-dev \ |
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.
We need to add apt update
in here:
- L1-L57 are using cache layers
- L58 changed, so that will reinstall but still use the old apt update results (L37), so CI failed.
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 let me have a try.
But if we add apt update
here, does it means that the cache will be disabled from L58?
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.
The cache will be invalidated if you change the line. the apt update
is only to refresh ubuntu package list (local copy).
b8d4573
to
87adbc8
Compare
### What changes were proposed in this pull request? follow the [Best practices for writing Dockerfiles](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#apt-get) : > Always combine RUN apt-get update with apt-get install in the same RUN statement. ### Why are the changes needed? 1, to address #42253 (comment) 2, when I attempted to change the apt-get install in #41918, the behavior was confusing. By following the best practices, further changes should work immediately. ### Does this PR introduce _any_ user-facing change? NO, dev-only ### How was this patch tested? CI ### Was this patch authored or co-authored using generative AI tooling? NO Closes #42842 from zhengruifeng/infra_docker_file_opt. Authored-by: Ruifeng Zheng <[email protected]> Signed-off-by: Ruifeng Zheng <[email protected]>
What changes were proposed in this pull request?
Why are the changes needed?
Does this PR introduce any user-facing change?
How was this patch tested?