Skip to content

Navigation Menu

Sign in
Sign up

tools-image: Clear /tmp contents as last step - #441

Open
Jeremi Piotrowski (jepio) wants to merge 1 commit into
Azure:master from
jepio:jepio/clean-tmp
Open

tools-image: Clear /tmp contents as last step #441
Jeremi Piotrowski (jepio) wants to merge 1 commit into
Azure:master from
jepio:jepio/clean-tmp

Conversation

@jepio

Copy link
Copy Markdown

/tmp in cloudshell has a whole bunch of leftover directories and files from the various installation steps that run during the build. Clear /tmp/ as the final step before finalizing the image. This doesn't make the image smaller because the files are still present in previous layers but makes the user experience better.

/tmp in cloudshell has a whole bunch of leftover directories and files
from the various installation steps that run during the build. Clear
/tmp/ as the final step before finalizing the image. This doesn't make
the image smaller because the files are still present in previous layers
but makes the user experience better.
Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
Comment thread linux/tools.Dockerfile
# Remove su so users don't have su access by default.
RUN rm -f ./linux/Dockerfile && rm -f /bin/su
# cleanup tmp files left behind by installation
RUN find /tmp/ -mindepth 1 -delete

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering if we can clean up such stuff as soon as it is created in any RUN step? So there is no cruft in any layer.

As in this is a nice addition from security POV, but not from the size POV.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would love to, but the files seem to come many differents RUN steps, and it would make the dockerfile quite hard to read. Although i will check - maybe it's only a small number of RUN that need the cleanup.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@surajssd Suraj Deshmukh (surajssd) surajssd left review comments
Reviewers whose approvals may not affect merge requirements

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /