Page MenuHomePhabricator

CI docker build should use a git cache
Closed, DeclinedPublic

Description

Whenever we rebuild a CI docker image, cloning operations/puppet or mediawiki/core from scratch is a pain. We should use a local cache as a reference.

Self note: Tyler and Antoine did something similar with Quibble using a local cache which is them exposed as a volume to clone from

Event Timeline

Can be done by:

  • having some bare repositories on the build host
  • expose them via a volume: -v /srv/git:/srv/git
  • then clone from /srv/git/foobar.git

This way the clone is mostly a local copy.

We cant use --reference, since later /srv/git is not availble.

docker build doesn't support mounting a volume.

For CI the git cache is on the host which is then mounted at run time with -v /srv/git:/srv/git:ro. zuul-cloner uses that to clone the repo.