-
Notifications
You must be signed in to change notification settings - Fork 383
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
[#1891] improvement(dev): dockerfile remove cache after installing packages #2090
[#1891] improvement(dev): dockerfile remove cache after installing packages #2090
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.
LGTM
@xunliu |
dev/docker/hive/Dockerfile
Outdated
@@ -151,6 +151,10 @@ RUN chown -R datastrato:hadoop /home/datastrato | |||
# removed install packages | |||
RUN rm -rf /tmp/packages | |||
|
|||
################################################################################ | |||
# removed install cache | |||
RUN rm -rf /var/cache/apt/* |
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.
hi @zhuzilong2013 Thank you for your contribution.
I think it's best to use the apt clean
command to remove the cached files, but this needs to be tested.
https://askubuntu.com/questions/1350375/can-i-delete-var-cache-apt-archives
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 comment. It's my mistake. I should use rm -rf /var/lib/apt/list/*
actually.
In https://docs.docker.com/develop/develop-images/instructions/#run:
Official Debian and Ubuntu images automatically run apt-get clean, so explicit invocation is not required.
I will fix and test it. I also want to move 'mysql-sever' to basic tools, what do you think?
@zhuzilong2013 |
@yuqi1129 Please review it:) |
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.
hi @zhuzilong2013 Thank you for your updated.
Have you tested to correctly create the Docker image using your development branch?
hello @xunliu , I found the mysql silent installation failed because I moved 'mysql-sever' to basic tools. I added a new ARG to resolve it. |
@@ -9,6 +9,7 @@ LABEL maintainer="[email protected]" | |||
ARG HADOOP_PACKAGE_NAME | |||
ARG HIVE_PACKAGE_NAME | |||
ARG JDBC_DIVER_PACKAGE_NAME | |||
ARG DEBIAN_FRONTEND=noninteractive |
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.
Where use this DEBIAN_FRONTEND
arg? I didn't find it anywhere.
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 added it because I moved 'mysql-sever' to basic tools.
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.
OK, I found DEBIAN_FRONTEND
it in the
https://askubuntu.com/questions/972516/debian-frontend-environment-variable
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.
LGTM
Has this PR been tested by IT? @xunliu @zhuzilong2013 |
What changes were proposed in this pull request?
Remove cache after installing packages.
Why are the changes needed?
Fix: #1891
Does this PR introduce any user-facing change?
N/A
How was this patch tested?
By hand