Skip to content
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

Run containers as non-root & reduce the size of pcw image #217

Merged
merged 2 commits into from
Feb 22, 2023

Conversation

ricardobranco777
Copy link
Collaborator

@ricardobranco777 ricardobranco777 commented Feb 22, 2023

This PR:

  • Makes it possible to run the containers as non-root
  • Adds --no-cache-dir to pip install to reduce the size by 53M

Fixes: #206

Related MR:
https://gitlab.suse.de/qac/publiccloud-qa-suse-de/-/merge_requests/70

@pdostal
Copy link
Collaborator

pdostal commented Feb 22, 2023

Is --no-cache-dir necessary when we have && rm -rf /var/cache at the end of that command?

@codecov
Copy link

codecov bot commented Feb 22, 2023

Codecov Report

Base: 70.93% // Head: 70.93% // No change to project coverage 👍

Coverage data is based on head (61077f6) compared to base (5454702).
Patch has no changes to coverable lines.

❗ Current head 61077f6 differs from pull request most recent head 029b318. Consider uploading reports for the commit 029b318 to get more accurate results

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #217   +/-   ##
=======================================
  Coverage   70.93%   70.93%           
=======================================
  Files          16       16           
  Lines        1194     1194           
=======================================
  Hits          847      847           
  Misses        347      347           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@ricardobranco777
Copy link
Collaborator Author

Is --no-cache-dir necessary when we have && rm -rf /var/cache at the end of that command?

Yes, because the Python cache dir resides in $HOME/.cache/pip.

# du -sh  /root/.cache/pip/
53M	/root/.cache/pip/

@ricardobranco777 ricardobranco777 force-pushed the dockerfile_fixes branch 2 times, most recently from 72cd09f to d9d8762 Compare February 22, 2023 11:36
@ricardobranco777 ricardobranco777 added the wip Work in progress label Feb 22, 2023
@ricardobranco777 ricardobranco777 changed the title Reduce the size of pcw image Run containers as non-root & reduce the size of pcw image Feb 22, 2023
@ricardobranco777 ricardobranco777 removed the wip Work in progress label Feb 22, 2023
@ricardobranco777 ricardobranco777 added the wip Work in progress label Feb 22, 2023
@ricardobranco777 ricardobranco777 removed the wip Work in progress label Feb 22, 2023
@asmorodskyi asmorodskyi merged commit b675108 into SUSE:master Feb 22, 2023
@ricardobranco777 ricardobranco777 deleted the dockerfile_fixes branch February 22, 2023 14:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Run the container as a non-root user
3 participants