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

Delete source code in the docker image #10

Open
duanqn opened this issue Mar 3, 2021 · 2 comments
Open

Delete source code in the docker image #10

duanqn opened this issue Mar 3, 2021 · 2 comments

Comments

@duanqn
Copy link

duanqn commented Mar 3, 2021

/usr/local/src takes up several GBs in the resulting docker image. Deleting the source code can greatly reduce the size of the docker image.
If you are concerned about open source license compliance, you can put in a file containing URLs pointing to their original repositories.

@xkszltl
Copy link
Owner

xkszltl commented Apr 2, 2021

This is not only for license compliance, but mostly for our own convenience during debugging.
If for licensing I may zip those code.

Because of the following, our version (including git hash) cannot point to where the code use in build come from:

  1. Libs constantly requires patching, and those patch commit won't be available in repo.
  2. We cannot couple our release cycle to upstreams, and it's not even possible, as our libs set growth, to align to all upstream release cycle. We often need to take things (both features and patches) from master branch.
  3. Some libs don't even have a release cycle.

Initially I only keep source code itself, but later on due to user asks, I add history as well.

Even though several GB sounds like a lot by itself, it's only a few percent of the entire docker.
Given the convenience of having code in hand, I don't think it's a good deal to trade it for a few GB.

@xkszltl
Copy link
Owner

xkszltl commented Apr 2, 2021

Note that these GB I mentioned are for storage.
Network traffic GB is another story, as they're expensive.
However, docker image is zipped.
For source code, they should have high compression ratio in docker image.

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

No branches or pull requests

2 participants