Hi all,
For any one who happens to be here, I managed to do it by building a new image, tagged newgit, from the Discourse official base image, and then installing Discourse upon that by modifying the image variable in launcher.
The main instructions in the Dockerfile are as followed. All dependencies (perl, gcc, etc) are handled by the base image.
# install a git free of gnutls
RUN cd / && \
vcurl=7.68.0 && wget http://dl.uxnr.de/mirror/curl/curl-$vcurl.tar.gz && \
vssl=1.1.1f && wget http://www.openssl.org/source/openssl-$vssl.tar.gz && \
vgit=2.31.1 && wget http://mirrors.edge.kernel.org/pub/software/scm/git/git-$vgit.tar.gz && \
tar -zxf curl-$vcurl.tar.gz && tar -zxf openssl-$vssl.tar.gz && \
tar -zxf git-$vgit.tar.gz && \
cd openssl-$vssl && ./config --prefix=/usr/local && make && make install && cd .. && \
cd curl-$vcurl && ./configure --with-ssl=/usr/local --prefix=/usr/local --without-gnutls --disable-ldap --without-librtmp && make && make install && cd .. && \
cd git-$vgit && make configure && ./configure --prefix=/usr/local --with-openssl=/usr/local --with-curl=/usr/local && make && make install && cd ../ && \
rm -rf /curl-${vurl}* /openssl-${vssl}* /git-${vgit}*
# check git install
RUN which git && git version && (ldd -v /usr/local/libexec/git-core/git-remote-https | grep gnutls) || echo "Git is not linked to libgnutls"
and gives /usr/local/bin/git.
I am aware that this be a dirty hack and not recommended by the dev team. I put it here only as a reference from a Docker layman, in case that someone had a similar demand.