Docker Ubuntu tweaks (#2975)

* Added .vagrant to gitignore

* Updated ubuntu docker images to use headless jdk + reduced update calls

- Altered the ubuntu dockerfiles to use the headless jdk, which prevents
the containers downloading a lot of pointless GUI libraries.

- Changed the command order of the 14.04 compile file to reduce the
overall number of `apt-get update` commands.

- Removed ubutnu 15.10 option as this version of ubuntu is no longer
supported with security updates etc.

- Updated docker/scripts help text to reflect the above

* Updated dockerfile and scripts for debian to v9 and remove apt-get clean

- Updated all references from debian 8 to 9 (as the Java slim images
uses debian 9).

- Updated all help text to refer to debian9.

- Removed apt-get clean commands from ubuntu docker files as they are
not required.
diff --git a/docker/base/Dockerfile.base.debian8 b/docker/base/Dockerfile.base.debian9
similarity index 100%
rename from docker/base/Dockerfile.base.debian8
rename to docker/base/Dockerfile.base.debian9
diff --git a/docker/compile/Dockerfile.debian8 b/docker/compile/Dockerfile.debian9
similarity index 100%
rename from docker/compile/Dockerfile.debian8
rename to docker/compile/Dockerfile.debian9
diff --git a/docker/compile/Dockerfile.ubuntu14.04 b/docker/compile/Dockerfile.ubuntu14.04
index c0b6aa5..4282a00 100644
--- a/docker/compile/Dockerfile.ubuntu14.04
+++ b/docker/compile/Dockerfile.ubuntu14.04
@@ -4,6 +4,11 @@
 ENV TARGET_PLATFORM ubuntu
 ENV bazelVersion 0.14.1
 
+RUN apt-get update && apt-get install -y software-properties-common
+
+RUN add-apt-repository ppa:george-edison55/cmake-3.x
+RUN add-apt-repository ppa:openjdk-r/ppa
+
 RUN apt-get update && apt-get -y install \
       automake \
       build-essential \
@@ -14,17 +19,12 @@
       python \
       python2.7-dev \
       python-software-properties \
-      software-properties-common \
       python-setuptools \
       zip \
       unzip \
-      wget
-
-RUN add-apt-repository ppa:george-edison55/cmake-3.x && apt-get -y update && \
-      apt-get -y install cmake
-
-RUN add-apt-repository ppa:openjdk-r/ppa && apt-get -y update
-RUN apt-get -y install openjdk-8-jdk
+      wget \
+      cmake \
+      openjdk-8-jdk-headless
 
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 
diff --git a/docker/compile/Dockerfile.ubuntu15.10 b/docker/compile/Dockerfile.ubuntu15.10
deleted file mode 100644
index ee9fa2f..0000000
--- a/docker/compile/Dockerfile.ubuntu15.10
+++ /dev/null
@@ -1,34 +0,0 @@
-FROM ubuntu:15.10
-
-# This is passed to the heron build command via the --config flag
-ENV TARGET_PLATFORM ubuntu
-ENV bazelVersion 0.14.1
-
-RUN apt-get update && apt-get -y install \
-      automake \
-      build-essential \
-      cmake \
-      curl \
-      libssl-dev \
-      git \
-      libtool \
-      libtool-bin \
-      python \
-      python2.7-dev \
-      python-software-properties \
-      software-properties-common \
-      python-setuptools \
-      zip \
-      unzip \
-      wget
-
-RUN apt-get -y install openjdk-8-jdk
-
-ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
-
-RUN wget -O /tmp/bazel.sh https://github.com/bazelbuild/bazel/releases/download/$bazelVersion/bazel-$bazelVersion-installer-linux-x86_64.sh \
-      && chmod +x /tmp/bazel.sh \
-      && /tmp/bazel.sh
-
-ADD bazelrc /root/.bazelrc
-ADD scripts/compile-platform.sh /compile-platform.sh
diff --git a/docker/compile/Dockerfile.ubuntu16.04 b/docker/compile/Dockerfile.ubuntu16.04
index ade285c..0d17f1f 100644
--- a/docker/compile/Dockerfile.ubuntu16.04
+++ b/docker/compile/Dockerfile.ubuntu16.04
@@ -23,7 +23,7 @@
       unzip \
       wget
 
-RUN apt-get -y install openjdk-8-jdk
+RUN apt-get update && apt-get -y install openjdk-8-jdk-headless
 
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 
diff --git a/docker/dist/Dockerfile.dist.debian8 b/docker/dist/Dockerfile.dist.debian9
similarity index 100%
rename from docker/dist/Dockerfile.dist.debian8
rename to docker/dist/Dockerfile.dist.debian9
diff --git a/docker/dist/Dockerfile.dist.ubuntu14.04 b/docker/dist/Dockerfile.dist.ubuntu14.04
index 56005c5..996ccd9 100644
--- a/docker/dist/Dockerfile.dist.ubuntu14.04
+++ b/docker/dist/Dockerfile.dist.ubuntu14.04
@@ -5,11 +5,10 @@
     unzip \
     software-properties-common \
     supervisor \
-    curl && \
-    apt-get clean all
+    curl
 
 RUN add-apt-repository ppa:openjdk-r/ppa && apt-get -y update && \
-    apt-get -y install openjdk-8-jdk && apt-get clean all
+    apt-get -y install openjdk-8-jdk
 
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 RUN update-ca-certificates -f
diff --git a/docker/dist/Dockerfile.dist.ubuntu15.10 b/docker/dist/Dockerfile.dist.ubuntu15.10
deleted file mode 100644
index 60758ad..0000000
--- a/docker/dist/Dockerfile.dist.ubuntu15.10
+++ /dev/null
@@ -1,29 +0,0 @@
-FROM ubuntu:16.04
-
-RUN apt-get update
-RUN apt-get -y install python ; apt-get clean all
-RUN apt-get -y install unzip ; apt-get clean all
-RUN apt-get -y install software-properties-common ; apt-get clean all
-RUN apt-get -y install curl ; apt-get clean all
-RUN apt-get -y install supervisor; apt-get clean all
-
-RUN apt-get -y install openjdk-8-jdk; apt-get clean all
-
-ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
-RUN update-ca-certificates -f
-
-ADD artifacts /heron
-
-WORKDIR /heron
-
-# run heron installer
-RUN /heron/heron-install.sh
-
-RUN tar --strip-components=1 -m -zxvf /heron/heron-core.tar.gz -C /heron
-
-RUN rm -f /heron/heron-tools-install.sh
-RUN rm -f /heron/heron-client-install.sh
-RUN rm -f /heron/heron-core.tar.gz
-
-ENV HERON_HOME /heron/heron-core/
-RUN export HERON_HOME
diff --git a/docker/dist/Dockerfile.dist.ubuntu16.04 b/docker/dist/Dockerfile.dist.ubuntu16.04
index 60758ad..e233da9 100644
--- a/docker/dist/Dockerfile.dist.ubuntu16.04
+++ b/docker/dist/Dockerfile.dist.ubuntu16.04
@@ -1,13 +1,14 @@
 FROM ubuntu:16.04
 
 RUN apt-get update
-RUN apt-get -y install python ; apt-get clean all
-RUN apt-get -y install unzip ; apt-get clean all
-RUN apt-get -y install software-properties-common ; apt-get clean all
-RUN apt-get -y install curl ; apt-get clean all
-RUN apt-get -y install supervisor; apt-get clean all
 
-RUN apt-get -y install openjdk-8-jdk; apt-get clean all
+RUN apt-get -y install \
+    python \
+    unzip \
+    software-properties-common \
+    curl \
+    supervisor \
+    openjdk-8-jdk-headless
 
 ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
 RUN update-ca-certificates -f
diff --git a/docker/scripts/build-artifacts.sh b/docker/scripts/build-artifacts.sh
index 925bc02..73697bc 100755
--- a/docker/scripts/build-artifacts.sh
+++ b/docker/scripts/build-artifacts.sh
@@ -150,7 +150,7 @@
     echo "  "
     echo "Script to build heron artifacts for different platforms"
     echo "  "
-    echo "Platforms Supported: darwin, ubuntu14.04, ubuntu15.10, ubuntu16.04 centos7 debian8"
+    echo "Platforms Supported: darwin, ubuntu14.04, ubuntu16.04, centos7, debian9"
     echo "  "
     echo "Example:"
     echo "  ./build-artifacts.sh ubuntu14.04 0.12.0 ."
diff --git a/docker/scripts/build-base.sh b/docker/scripts/build-base.sh
index 6b0e07c..18bbc1b 100755
--- a/docker/scripts/build-base.sh
+++ b/docker/scripts/build-base.sh
@@ -75,7 +75,7 @@
     echo "  "
     echo "Usage: $0 <platform> <version_string> <output-directory>"
     echo "  "
-    echo "Platforms Supported: debian8, ubuntu14.04, centos7"
+    echo "Platforms Supported: debian9, ubuntu14.04, ubuntu16.04, centos7"
     echo "  "
     echo "Example:"
     echo "  ./build-base.sh ubuntu14.04 0.12.0 ~/ubuntu"
diff --git a/docker/scripts/build-docker.sh b/docker/scripts/build-docker.sh
index f53496a..4ba32b2 100755
--- a/docker/scripts/build-docker.sh
+++ b/docker/scripts/build-docker.sh
@@ -72,7 +72,7 @@
     echo "  "
     echo "Usage: $0 <platform> <version_string> <artifact-directory> "
     echo "  "
-    echo "Platforms Supported: ubuntu14.04, ubuntu15.10, ubuntu16.04 centos7 debian8"
+    echo "Platforms Supported: ubuntu14.04, ubuntu16.04, centos7, debian8"
     echo "  "
     echo "Example:"
     echo "  ./build-docker.sh ubuntu14.04 0.12.0 ~/ubuntu"
diff --git a/docker/scripts/build-exec-docker.sh b/docker/scripts/build-exec-docker.sh
index f8b8559..158c38e 100755
--- a/docker/scripts/build-exec-docker.sh
+++ b/docker/scripts/build-exec-docker.sh
@@ -70,7 +70,7 @@
   *)
     echo "Usage: $0 <platform> <version_string> <output-directory> "
     echo "  "
-    echo "Platforms Supported: ubuntu14.04, ubuntu15.10, ubuntu16.04 centos7"
+    echo "Platforms Supported: ubuntu14.04, ubuntu16.04, debian9, centos7"
     echo "  "
     echo "Example:"
     echo "  ./build-exec-docker.sh ubuntu14.04 0.12.0 ."
diff --git a/docker/scripts/ci-docker.sh b/docker/scripts/ci-docker.sh
index a45c995..94c205b 100755
--- a/docker/scripts/ci-docker.sh
+++ b/docker/scripts/ci-docker.sh
@@ -127,7 +127,7 @@
   *)
     echo "Usage: $0 <operation> <platform> <version_string> <tag-prefix> <input-output-directory> "
     echo "  "
-    echo "Platforms Supported: latest ubuntu14.04, ubuntu15.10, ubuntu16.04 centos7"
+    echo "Platforms Supported: latest, ubuntu14.04, ubuntu16.04, centos7, debian9"
     echo "  "
     echo "Example:"
     echo "  $0 build ubuntu14.04 0.12.0 heron ."
diff --git a/vagrant/.gitignore b/vagrant/.gitignore
new file mode 100644
index 0000000..dace708
--- /dev/null
+++ b/vagrant/.gitignore
@@ -0,0 +1 @@
+/.vagrant