We have seen an issue where `rm -r "$HOME/.gradle"` fails because
"Directory not empty". It seems likely this is due the fact Gradle is
still running in daemon form. The build script doesn't get any advantage
by running the daemon, so we just disable it.
Fixes#20423
This reduces the container size from 1.4 GB to 640 MB. 129 MB is
jessie, 489 MB jdk, and 22 MB grpc-java. When we swap from jessie to
stretch, we could swap to openjdk:8-jdk-slim-stretch which would make
the entire image 265 MB.
Python was never needed; it was added by mistake in 0589e533.
Pre-downloading gradle artifacts isn't helpful these days, because we
build on a clean machine. Git isn't needed as cp is sufficient. libapr1
has not been required by tcnative for a long time, and we even use
tcnative-boringssl-static since at least 1.0, which also doesn't need
it. The final cleanup is to remove source and downloaded artifacts when
done compiling.
-) Don't re-clone from github. We already have the directory here, just bind it, and copy it inside the docker container.
-) Let's properly set up our environment for asan.
-) Let's split the docker "run_jenkins" part into its own separate script.