Skip to content

Make Docker image smaller (1.21GB → 558MB) #2386

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

Merged
merged 2 commits into from
Feb 15, 2021
Merged

Make Docker image smaller (1.21GB → 558MB) #2386

merged 2 commits into from
Feb 15, 2021

Conversation

tiulpin
Copy link
Contributor

@tiulpin tiulpin commented Feb 8, 2021

What these changes are about:

  • switch from python:3.6 to python:3.6-slim-buster
  • install libgomp1 (it's missed in slim-buster images)
  • clean apt caches even more than before

The result: Docker image size reduced from 1.21GB to 558MB (local, non-compressed size).
Didn't find the tests for Docker images, but checked: everything is working as before, but the image is smaller, easier to download from Docker Hub, and use!

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

Thank you ++
I have a minor comment inline.

Eventually we should get that image built and scanned with https://github.com/nexB/scancode.io/blob/main/scanpipe/pipelines/docker.py ;)

@pombredanne
Copy link
Member

@tiulpin you wrote:

Didn't find the tests for Docker images, but checked: everything is working as before, but the image is smaller, easier to download from Docker Hub, and use!

there is no tests yet... if you know how to add some that would be sweet-o-sweet!

Unrelated, since you seem to dabble in ML, you may be interested to check out @AyanSinhaMahapatra WIP on this scancode plugin https://github.com/nexB/scancode-results-analyzer/ that tries to use some ML to spot (and fix) inconsistent license detections.

Signed-off-by: Viktor Tiulpin <[email protected]>
Signed-off-by: tiulpin <[email protected]>
@tiulpin
Copy link
Contributor Author

tiulpin commented Feb 15, 2021

there is no tests yet... if you know how to add some that would be sweet-o-sweet!

Will try to add it in next PRs, OK?)

But now this is ready to be merged for sure, including your resolved comment.

@pombredanne
Copy link
Member

LGTM, merging!
Thank you ++

@pombredanne pombredanne merged commit 5174a3b into aboutcode-org:develop Feb 15, 2021
@tiulpin tiulpin deleted the slim-docker branch February 15, 2021 19:22
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.

2 participants