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

Give some love to the Dockerfile #60

Closed
4 of 9 tasks
humitos opened this issue Mar 7, 2018 · 4 comments · Fixed by #166
Closed
4 of 9 tasks

Give some love to the Dockerfile #60

humitos opened this issue Mar 7, 2018 · 4 comments · Fixed by #166
Labels
Improvement Minor improvement to code
Milestone

Comments

@humitos
Copy link
Member

humitos commented Mar 7, 2018

It would be awesome to follow some of the tips and tricks to build good Docker images like:

  • use multi stage builds
  • remove all residuals after apt
  • remove pyenv build environments after compiling
  • remove all pyenv dependencies installed via apt
  • --squash, although it's in experimental :/
  • delete miniconda .sh file after installed
  • wget master.zip pyenv instead of clone it
  • pip cache (--no-cache-dir should be useful)
  • more?

Ref: https://docs.docker.com/v17.09/engine/userguide/eng-image/dockerfile_best-practices/

@humitos
Copy link
Member Author

humitos commented Mar 7, 2018

Just built 18.04 image from #59

readthedocs/build  18.04  27e5be0051e1  2 minutes ago  7.33GB

@bebehei
Copy link
Contributor

bebehei commented Feb 16, 2019

--squash won't be a good choice. This docker image keeps adding files layer by layer. It does not change, delete or replace any files.

@bebehei
Copy link
Contributor

bebehei commented Feb 16, 2019

use multistage builds: This might shave off some hundred MBs in the image.

I'm not deep into the rtd project internals yet. So how many of those -dev packages are superfluous after the build?

@varac
Copy link

varac commented Jun 2, 2020

Yes please, the insane size of the image holds me back from using it, really (readthedocs/build:7.0 is ~3gb big).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Improvement Minor improvement to code
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants