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

Build deps removal dilemma #66

Open
ykshatroff opened this issue Dec 19, 2019 · 1 comment
Open

Build deps removal dilemma #66

ykshatroff opened this issue Dec 19, 2019 · 1 comment

Comments

@ykshatroff
Copy link
Contributor

ykshatroff commented Dec 19, 2019

This is not a bug on its own, but rather a question of efficiency.

If I add some python library that requires binary objects to be built or run (examples: lxml requires libxml2 and libxslt, postgres psycopg2 requires libpq to run and postgresql-dev to build, etc) then I would have to essentially repeat all the installation and removal rituals in my descendant image. At the same time it would be more efficient to just have a custom dockerfile with the cleanup done once in the last stage of the build, and just docker-squash the resulting image.

Currently I see several ways out of this dilemma:

  • provide template dockerfiles for that particular approach, where you could edit the dockerfile, adding the necessary libraries between the build tools installation command and the cleanup, and let the user squash the image after build;
  • add an ARG so that the installed tools would be controlled (added) by this build time argument, and this would not even require squashing the image.

There might be other ways of doing it, any ideas/suggestions?

@jfloff
Copy link
Owner

jfloff commented Mar 27, 2020

I think the better way is to just have another image that builds on this one. I think this situation is the same issue I had, and that lead me to build docker-alscipy. Is this the case, correct me if I'm wrong.

I feel that the template approach would lead to the same problem, which is you would have to build them anyways. The ARG argument might be solved with the slim tag but that also requires the image to be built, and don't change that.

Any other ideas?

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