Fix grpc_java* Docker images
The images seem to have been broken starting with 12e12a3, but the
removal of Maven support from grpc-java also broke them further.
SSH handling no longer uses $HOME as it does not agree with /etc/passwd
in older docker versions[1] and prevented SSH from seeing the config
file.
Some effort was also made to reduce the image sizes by removing
temporary files.
1. https://github.com/docker/docker/issues/2968
diff --git a/tools/dockerfile/grpc_java/Dockerfile b/tools/dockerfile/grpc_java/Dockerfile
index f234f51..a5508ca 100644
--- a/tools/dockerfile/grpc_java/Dockerfile
+++ b/tools/dockerfile/grpc_java/Dockerfile
@@ -1,13 +1,11 @@
# Dockerfile for the gRPC Java dev image
FROM grpc/java_base
-RUN cd /var/local/git/grpc-java/lib/okhttp && \
- mvn -pl okhttp -am install
-RUN cd /var/local/git/grpc-java/lib/netty && \
- mvn -pl codec-http2 -am -DskipTests install
+RUN git clone --recursive --depth 1 git@github.com:google/grpc-java.git /var/local/git/grpc-java
+RUN cd /var/local/git/grpc-java/lib/netty && \
+ mvn -pl codec-http2 -am -DskipTests install clean
RUN cd /var/local/git/grpc-java && \
- protoc --version>ver.txt && \
- mvn install
+ ./gradlew build
# Specify the default command such that the interop server runs on its known testing port
CMD ["/var/local/git/grpc-java/run-test-server.sh", "--use_tls=true", "--port=8030"]