"git clone" with depth=1 for OCI builds?

Asked by Thomas Bechtold

I'm constantly running into build failures because the "git clone" step is running super long:

Setting up libgssapi3-heimdal:amd64 (7.5.0+dfsg-1) ...
Setting up libldap-2.4-2:amd64 (2.4.45+dfsg-1ubuntu1.10) ...
Setting up libcurl3-gnutls:amd64 (7.58.0-2ubuntu3.14) ...
Setting up git (1:2.17.1-1ubuntu0.8) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Running repo phase...
Cloning into '20.04'...

(this is from https://launchpad.net/~cloud-images-release-managers/cloud-images/+oci/ubuntu-base/+recipe/20.04/+build/2035 ).

The problem is that the git repo contains tar.gz files (because there is currently no other way to build a base image - the tarball must be stored in git).
To reduce the size that is cloned, maybe "git clone depth=1" can be used so only the last commit is cloned? Would that be easily possible?

Question information

English Edit question
Launchpad itself Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Colin Watson (cjwatson) said :

That seems worth exploring. Please use the "Create bug report" link on this question to convert this question into a bug report.

Can you help with this problem?

Provide an answer of your own, or ask Thomas Bechtold for more information if necessary.

To post a message you must log in.