WIP: make gradle builds work inside docker containers

Basically working. The only thing left (I think) is to change the Dockerfile to use the version of Gradle 2.2 instead of 1.4, and then the test output should match between `-mprogram` and `-mdocker`