Closed humitos closed 2 years ago
Good feedback here!
Couple
apt-get update
withrm -rf /var/lib/apt/lists/*
in the same layer (although I don't think that plays along well with our multi-layeredapt-get install
- we would need to doupdate && install && rm -rf /var/lib/...
in every layer, which will slow down the builds a bit)
docker run -u root -it readthedocs/build:ubuntu20 /bin/bash
root@42d3d0f8fe1a:/home/docs# du -sh /var/lib/apt/lists/
29M /var/lib/apt/lists/
I don't think we are spending a lot of disk space. However, I agree it could be a good optimization. As you already noticed, we will need to call apt-get update
on each apt-get install
command that we run.
On the other hands, packages (.deb
files) are cleaned up automatically when using official Ubuntu images because they comes with a post-install hook for this:
docs@927b877e91c3:~$ cat /etc/apt/apt.conf.d/docker-clean
DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };
APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };
Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";
docs@927b877e91c3:~$
Use
--no-install-recommends
to be more explicit about what are we installing and why
I'm not sure about this one. I think it's a good idea to know exactly what we are installing. However, if add this option now, I wonder if all the PDFs will keep building correctly (e.g. the right font, or stylesheets).
@agjohnson I addressed all your comments and made the tests run on CircleCI. Is there any blocker to merge this PR?
Hurray! 🎉
Dockerfile
(s) required to build the new build images (ubuntu20-*
) that useasdf
to install languages requirements (python
,node
,rust
,go
)Design documents:
Implementation:
How to build this image
docker build -t readthedocs/build:ubuntu-20.04 .
TODO
asdf
is installed correctlyapt-get
(see #158)jsdoc
andtypedoc
are required in the new images and in that case, how to handle them (see #147)Closes #170 Closes #60 Closes #158 Closes #107 Closes #90 Closes #86 Closes #108 Closes #91 Closes #64 Closes #130 Closes #177 Closes #176 Closes #48