Enable git protocol v2 in container images

Git versions between 2.18 and 2.26 have version 2 protocol support
but it's not enabled by default. Starting in 2.26, it is the
default.  V2 is more efficient at negotiating refs and can reduce
the time spent updating a repo by 50% on large repos.

This adds a setting to the container images to specify that v2
should be used.  The images are currently built with git 2.20, which
is in the range where this is needed.

Change-Id: Ifc471c5fde49c65137bc34e49734b3ac3d33e3e1
This commit is contained in:
James E. Blair 2020-12-11 09:15:45 -08:00
parent c911e26fa6
commit f3e8c809dc
1 changed files with 5 additions and 0 deletions

View File

@ -55,6 +55,11 @@ RUN /output/install-from-bindep zuul_base \
&& rm -rf /output
RUN useradd -u 10001 -m -d /var/lib/zuul -c "Zuul Daemon" zuul
# This enables git protocol v2 which is more efficient at negotiating
# refs. This can be removed after the images are built with git 2.26
# where it becomes the default.
RUN git config --system protocol.version 2
VOLUME /var/lib/zuul
CMD ["/usr/local/bin/zuul"]