From b5f7397b08de46e5241f7bcf74a4662917a42c0d Mon Sep 17 00:00:00 2001
From: Jan Tattermusch <jtattermusch@google.com>
Date: Fri, 5 Feb 2016 13:53:47 -0800
Subject: [PATCH] cleanup distribtest Dockerimages

---
 tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile | 1 -
 tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile  | 2 +-
 tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile  | 2 +-
 .../distribtest/csharp_ubuntu1404_x64/Dockerfile           | 2 +-
 .../distribtest/csharp_ubuntu1504_x64/Dockerfile           | 2 +-
 .../distribtest/csharp_ubuntu1510_x64/Dockerfile           | 2 +-
 .../distribtest/csharp_ubuntu1604_x64/Dockerfile           | 2 +-
 tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile  | 2 +-
 tools/dockerfile/distribtest/node_centos7_x64/Dockerfile   | 1 -
 tools/dockerfile/distribtest/node_jessie_x64/Dockerfile    | 2 +-
 tools/dockerfile/distribtest/node_jessie_x86/Dockerfile    | 2 +-
 .../dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile  | 2 +-
 .../dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile  | 2 +-
 .../dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile  | 2 +-
 .../dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile  | 2 +-
 .../dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile  | 2 +-
 tools/dockerfile/distribtest/python_arch_x64/Dockerfile    | 1 -
 tools/dockerfile/distribtest/python_centos6_x64/Dockerfile | 1 -
 tools/dockerfile/distribtest/python_centos7_x64/Dockerfile | 1 -
 .../dockerfile/distribtest/python_fedora20_x64/Dockerfile  | 7 +------
 .../dockerfile/distribtest/python_fedora21_x64/Dockerfile  | 7 +------
 .../dockerfile/distribtest/python_fedora22_x64/Dockerfile  | 7 +------
 .../dockerfile/distribtest/python_fedora23_x64/Dockerfile  | 7 +------
 tools/dockerfile/distribtest/python_jessie_x64/Dockerfile  | 4 +---
 tools/dockerfile/distribtest/python_jessie_x86/Dockerfile  | 4 +---
 .../dockerfile/distribtest/python_opensuse_x64/Dockerfile  | 2 --
 .../distribtest/python_ubuntu1204_x64/Dockerfile           | 6 +-----
 .../distribtest/python_ubuntu1404_x64/Dockerfile           | 6 +-----
 .../distribtest/python_ubuntu1504_x64/Dockerfile           | 6 +-----
 .../distribtest/python_ubuntu1510_x64/Dockerfile           | 6 +-----
 .../distribtest/python_ubuntu1604_x64/Dockerfile           | 6 +-----
 tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile  | 4 +---
 tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile   | 2 --
 tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile   | 2 --
 tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile  | 6 +-----
 tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile  | 6 +-----
 tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile  | 6 +-----
 tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile  | 6 +-----
 tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile    | 5 +----
 tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile    | 5 +----
 tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile  | 2 --
 .../dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile  | 5 +----
 .../dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile  | 5 +----
 .../dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile  | 5 +----
 .../dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile  | 5 +----
 .../dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile  | 5 +----
 tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile    | 5 +----
 tools/jenkins/docker_run.sh                                | 4 ++--
 tools/run_tests/distribtest_targets.py                     | 4 ++--
 49 files changed, 42 insertions(+), 141 deletions(-)

diff --git a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
index 17e9698904..03b5b364f8 100644
--- a/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_centos7_x64/Dockerfile
@@ -33,6 +33,5 @@ RUN rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E03
 RUN yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
 
 RUN yum install -y mono
-RUN yum install -y git
 RUN yum install -y unzip
 RUN yum install -y nuget
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
index 840ecf0fc2..1cadba3b7b 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x64/Dockerfile
@@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
index 3a50da4936..be962828c2 100644
--- a/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_jessie_x86/Dockerfile
@@ -40,4 +40,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
index 901c981acb..3d04d032b5 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1404_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
index 1b8d454681..5eec570491 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1504_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
index a6c26a4b9e..a6d60fb4b9 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1510_x64/Dockerfile
@@ -37,4 +37,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
index c6a8634937..61472704d7 100644
--- a/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_ubuntu1604_x64/Dockerfile
@@ -34,4 +34,4 @@ RUN apt-get update && apt-get install -y \
     ca-certificates-mono \
     nuget
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
index dd865e8bbc..9039c3c509 100644
--- a/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/csharp_wheezy_x64/Dockerfile
@@ -29,4 +29,4 @@
 
 FROM mono:4.2.2.30
 
-RUN apt-get update && apt-get install -y git unzip
+RUN apt-get update && apt-get install -y unzip
diff --git a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
index 9c1f5ee729..f6e1664086 100644
--- a/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_centos7_x64/Dockerfile
@@ -29,7 +29,6 @@
 
 FROM centos:7
 
-RUN yum install -y git
 RUN yum install -y curl
 
 # Install nvm
diff --git a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
index 69a071500e..4ca5e86563 100644
--- a/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_jessie_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM debian:jessie
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
index 173c70360d..bd40ab2b4c 100644
--- a/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/node_jessie_x86/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM 32bit/debian:jessie
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y git
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
index c53a4aa305..0134dc964e 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1204_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM ubuntu:12.04
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
index 8fe6ae1f33..0fae447946 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1404_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM ubuntu:14.04
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
index 013c2a0c72..55da46c3be 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1504_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM ubuntu:15.04
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
index 43b3ae2738..c050cab7d3 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1510_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM ubuntu:15.10
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
index 3eae75475c..ab9e8a32e3 100644
--- a/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/node_ubuntu1604_x64/Dockerfile
@@ -29,7 +29,7 @@
 
 FROM ubuntu:16.04
 
-RUN apt-get update && apt-get install -y curl git
+RUN apt-get update && apt-get install -y curl
 
 # Install nvm
 RUN touch .profile
diff --git a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
index 4d10e240c6..53bb8e8708 100644
--- a/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_arch_x64/Dockerfile
@@ -30,7 +30,6 @@
 FROM base/archlinux
 
 RUN pacman --noconfirm -Syy
-RUN pacman --noconfirm -S git
 RUN pacman --noconfirm -S python
 RUN pacman --noconfirm -S python-pip
 
diff --git a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
index 683686c6db..3889f8862f 100644
--- a/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_centos6_x64/Dockerfile
@@ -29,7 +29,6 @@
 
 FROM centos:6
 
-RUN yum install -y git
 RUN yum install -y python
 
 RUN rpm -ivh http://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
diff --git a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
index 6b70f65f10..114957b573 100644
--- a/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_centos7_x64/Dockerfile
@@ -29,7 +29,6 @@
 
 FROM centos:7
 
-RUN yum install -y git
 RUN yum install -y python
 RUN yum install -y epel-release
 RUN yum install -y python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
index 1c91594363..d58036410f 100644
--- a/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora20_x64/Dockerfile
@@ -29,9 +29,4 @@
 
 FROM fedora:20
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
index e35de109ea..b44fcff7e3 100644
--- a/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora21_x64/Dockerfile
@@ -29,9 +29,4 @@
 
 FROM fedora:21
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
index 69c3b541d3..c6415946c3 100644
--- a/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora22_x64/Dockerfile
@@ -29,9 +29,4 @@
 
 FROM fedora:22
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
index 74639a3118..6c834d2bc2 100644
--- a/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_fedora23_x64/Dockerfile
@@ -29,9 +29,4 @@
 
 FROM fedora:23
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y python
-RUN yum install -y python-pip
-
+RUN yum clean all && yum update -y && yum install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
index 3d511e267a..5778d604c8 100644
--- a/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_jessie_x64/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM debian:jessie
 
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
index 035d56b655..cb6ec22d0a 100644
--- a/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/python_jessie_x86/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM 32bit/debian:jessie
 
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
index 032beb97e5..417d9e0293 100644
--- a/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_opensuse_x64/Dockerfile
@@ -29,7 +29,5 @@
 
 FROM opensuse:42.1
 
-RUN zypper --non-interactive install git
 RUN zypper --non-interactive install python
 RUN zypper --non-interactive install python-pip
-
diff --git a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
index 9dbf90f511..a48ce0eeef 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1204_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM ubuntu:12.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
index 3b366a9bb4..18dbfd4657 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1404_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM ubuntu:14.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
index de90b5b7e2..444a54d14b 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1504_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM ubuntu:15.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
index d10e04aacc..245ffb9413 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1510_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM ubuntu:15.10
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
index bc56285a3d..a1ac3051ba 100644
--- a/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_ubuntu1604_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM ubuntu:16.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y python
-RUN apt-get install -y python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
index 895dd96747..46353b92d6 100644
--- a/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/python_wheezy_x64/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM debian:wheezy
 
-RUN apt-get update
-RUN apt-get install -y git python python-pip
-
+RUN apt-get update -y && apt-get install -y python python-pip
diff --git a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
index 28a5c4ad71..fd2cf63a59 100644
--- a/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_centos6_x64/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM centos:6
 
-RUN yum install -y git
 RUN yum install -y ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
index bdc100ee1c..5bb9bd6fa6 100644
--- a/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_centos7_x64/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM centos:7
 
-RUN yum install -y git
 RUN yum install -y ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
index 50ff0b038b..9f23be986f 100644
--- a/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora20_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM fedora:20
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
index 219ecc8b53..57106a4894 100644
--- a/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora21_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM fedora:21
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
index 49d4c7d7f8..d770177381 100644
--- a/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora22_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM fedora:22
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
index 3c5363fb63..2c9b78ed08 100644
--- a/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_fedora23_x64/Dockerfile
@@ -29,8 +29,4 @@
 
 FROM fedora:23
 
-RUN yum clean all
-RUN yum update -y
-RUN yum install -y git
-RUN yum install -y ruby
-
+RUN yum clean all && yum update -y && yum install -y ruby
diff --git a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
index 6a3d7edba0..4784bd73b4 100644
--- a/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_jessie_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM debian:jessie
 
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
index ca3b731f56..4f649cbc03 100644
--- a/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_jessie_x86/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM 32bit/debian:jessie
 
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
index a9423042ea..a249950998 100644
--- a/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_opensuse_x64/Dockerfile
@@ -29,6 +29,4 @@
 
 FROM opensuse:42.1
 
-RUN zypper --non-interactive install git
 RUN zypper --non-interactive install ruby
-
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
index 66f17100cf..95b7702afb 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1204_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM ubuntu:12.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
index dc533a5fca..66ba01d37e 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1404_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM ubuntu:14.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
index 7e4f203041..81e7ca1d3c 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1504_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM ubuntu:15.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
index 43ef63ec8c..37b897f0f5 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1510_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM ubuntu:15.10
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
index 3b63976d3c..5c54b8f754 100644
--- a/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_ubuntu1604_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM ubuntu:16.04
 
-RUN apt-get update -y
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update -y && apt-get install -y ruby-full
diff --git a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
index 1ff083d43c..2e6593c230 100644
--- a/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
+++ b/tools/dockerfile/distribtest/ruby_wheezy_x64/Dockerfile
@@ -29,7 +29,4 @@
 
 FROM debian:wheezy
 
-RUN apt-get update
-RUN apt-get install -y git
-RUN apt-get install -y ruby-full
-
+RUN apt-get update && apt-get install -y ruby-full
diff --git a/tools/jenkins/docker_run.sh b/tools/jenkins/docker_run.sh
index 6fbae40ac2..519dc5cade 100755
--- a/tools/jenkins/docker_run.sh
+++ b/tools/jenkins/docker_run.sh
@@ -31,7 +31,7 @@
 # This script is invoked by build_docker_* inside a docker
 # container. You should never need to call this script on your own.
 
-set -e
+set -ex
 
 if [ "$RELATIVE_COPY_PATH" == "" ]
 then
@@ -39,7 +39,7 @@ then
   git clone --recursive "$EXTERNAL_GIT_ROOT" /var/local/git/grpc
 else
   mkdir -p "/var/local/git/grpc/$RELATIVE_COPY_PATH"
-  cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH/*" "/var/local/git/grpc/$RELATIVE_COPY_PATH"
+  cp -r "$EXTERNAL_GIT_ROOT/$RELATIVE_COPY_PATH"/* "/var/local/git/grpc/$RELATIVE_COPY_PATH"
 fi
 
 if [ -x "$(command -v rvm)" ]
diff --git a/tools/run_tests/distribtest_targets.py b/tools/run_tests/distribtest_targets.py
index a8c9020585..a1e45ece9d 100644
--- a/tools/run_tests/distribtest_targets.py
+++ b/tools/run_tests/distribtest_targets.py
@@ -38,13 +38,13 @@ def create_docker_jobspec(name, dockerfile_dir, shell_command, environ={},
   """Creates jobspec for a task running under docker."""
   environ = environ.copy()
   environ['RUN_COMMAND'] = shell_command
+  environ['RELATIVE_COPY_PATH'] = 'test/distrib'
 
   docker_args=[]
   for k,v in environ.iteritems():
     docker_args += ['-e', '%s=%s' % (k, v)]
   docker_env = {'DOCKERFILE_DIR': dockerfile_dir,
-                'DOCKER_RUN_SCRIPT': 'tools/jenkins/docker_run.sh',
-                'RELATIVE_COPY_PATH': 'test/distrib'}
+                'DOCKER_RUN_SCRIPT': 'tools/jenkins/docker_run.sh'}
   jobspec = jobset.JobSpec(
           cmdline=['tools/jenkins/build_and_run_docker.sh'] + docker_args,
           environ=docker_env,
-- 
GitLab