Add git 2.24.0 to build slaves

Make the git version configurable at build time
and allow to build slaves for different versions
of the git client, independently from the package
included with the distribution.

Change-Id: I11dc25266d6c1c3764e91ef63d528bbf446c325e
diff --git a/jenkins-docker/slave-debian/Dockerfile b/jenkins-docker/slave-debian/Dockerfile
index 1365856..7aa544c 100644
--- a/jenkins-docker/slave-debian/Dockerfile
+++ b/jenkins-docker/slave-debian/Dockerfile
@@ -13,7 +13,6 @@
 RUN apt-get update && apt-get install -y \
     openssh-server \
     curl \
-    git-core \
     xvfb \
     python-dev \
     python-pip \
@@ -26,8 +25,20 @@
     zip \
     vim \
     gettext-base \
+    libcurl4-gnutls-dev \
+    libexpat1-dev \
+    gettext \
+    libz-dev \
+    libssl-dev \
+    build-essential \
     && rm -rf /var/lib/apt/lists/*
 
+ADD https://www.kernel.org/pub/software/scm/git/git-$GIT_VER.tar.gz /tmp/
+RUN tar xvfz /tmp/git-$GIT_VER.tar.gz && \
+    cd git-$GIT_VER && \
+    make prefix=/usr all install && \
+    cd .. && rm -Rf git-$GIT_VER
+
 ADD http://www-eu.apache.org/dist/maven/maven-3/$MAVEN_VER/binaries/apache-maven-$MAVEN_VER-bin.tar.gz /usr/local
 
 RUN cd /usr/local && \
diff --git a/jenkins-docker/slave-debian/Makefile b/jenkins-docker/slave-debian/Makefile
index 9408f97..c00fa5d 100644
--- a/jenkins-docker/slave-debian/Makefile
+++ b/jenkins-docker/slave-debian/Makefile
@@ -1,6 +1,7 @@
 NO_CACHE ?= false
 IMAGE=gerritforge/gerrit-ci-slave-debian
 MAVEN_VER=3.6.1
+GIT_VER=2.24.0
 
 build: build_stretch
 
@@ -15,7 +16,7 @@
 build_stretch:  id_rsa.pub
 	@echo "Building Docker for Debian:$(DEBIAN_VER)"
 	@echo "========================================"
-	cat Dockerfile | DEBIAN_VER=$(DEBIAN_VER) MAVEN_VER=$(MAVEN_VER) envsubst > Dockerfile-$(DEBIAN_VER)
+	cat Dockerfile | DEBIAN_VER=$(DEBIAN_VER) MAVEN_VER=$(MAVEN_VER) GIT_VER=$(GIT_VER) envsubst > Dockerfile-$(DEBIAN_VER)
 	docker build --no-cache=$(NO_CACHE) -f Dockerfile-$(DEBIAN_VER) -t ${IMAGE}:$(DEBIAN_VER) .
 
 publish_stretch: