add rbe-debian9 and rbe-ubuntu16_04 container (#18)

* rename debian8-clang-fully-loaded to its official name: rbe-debian8

* rbe-debian9 with almost identical packages with rbe-debian8, except for libc++6-dev and ca-certificates-java

* rbe-ubuntu16_04 with almost identical packages with rbe-debian8, except for ca-certificates-java

Tested:
* container/build.sh -p my-project -c rbe-debian8 -d debian8 -t latest -b my-debs -a
* container/build.sh -p my-project -c rbe-ubuntu9 -d ubuntu9 -t latest -b my-debs -a
* container/build.sh -p my-project -c rbe-ubuntu16_04 -d ubuntu16_04 -t latest -b my-debs -a
* container/build.sh -d debian8 -l
* container/build.sh -d debian9 -l
* container/build.sh -d ubuntu16_04 -l
* tested produced rbe-debian9 and rbe-ubuntu16_04 image for building gRPC and Bazel
diff --git a/.bazelci/presubmit.yml b/.bazelci/presubmit.yml
index 50ce843..40d9d0c 100644
--- a/.bazelci/presubmit.yml
+++ b/.bazelci/presubmit.yml
@@ -12,7 +12,9 @@
     - "//test/configs:ubuntu-xenial-custom-bazel-rc-version-autoconfig_test"
     - "//test/configs:debian8_clang_autoconfig_test"
     - "//rules:debian8-clang-0.3.0-bazel_0.10.0-autoconfig_test"
-    - "//container/debian8-clang-fully-loaded:fl-toolchain-test"
+    - "//container/rbe-debian8:toolchain-test"
+    - "//container/experimental/rbe-debian9:toolchain-test"
+    - "//container/experimental/rbe-ubuntu16_04:toolchain-test"
   ubuntu1604:
     test_targets:
     - "//test/configs:debian-jessie-autoconfig_test"
@@ -25,4 +27,6 @@
     - "//test/configs:ubuntu-xenial-custom-bazel-rc-version-autoconfig_test"
     - "//test/configs:debian8_clang_autoconfig_test"
     - "//rules:debian8-clang-0.3.0-bazel_0.10.0-autoconfig_test"
-    - "//container/debian8-clang-fully-loaded:fl-toolchain-test"
+    - "//container/rbe-debian8:toolchain-test"
+    - "//container/experimental/rbe-debian9:toolchain-test"
+    - "//container/experimental/rbe-ubuntu16_04:toolchain-test"
diff --git a/WORKSPACE b/WORKSPACE
index 4f699e1..582abd7 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -43,6 +43,20 @@
 )
 
 container_pull(
+    name = "debian9",
+    digest = "sha256:1b77b1d6cbc79af00b68050880b7d8cb24b7631fe366501bd55bf3986c744f03",
+    registry = "gcr.io",
+    repository = "cloud-marketplace/google/debian9",
+)
+
+container_pull(
+    name = "ubuntu16_04",
+    digest = "sha256:c81e8f6bcbab8818fdbe2df6d367990ab55d85b4dab300931a53ba5d082f4296",
+    registry = "gcr.io",
+    repository = "cloud-marketplace/google/ubuntu16_04",
+)
+
+container_pull(
     name = "debian8-clang",
     digest = "sha256:feec68e34edc42f4c3b21720670003b0d76100fea8c06f965cd3687a2a66bfcf",
     registry = "gcr.io",
diff --git a/container/debian8-clang-fully-loaded/build.sh b/container/build.sh
similarity index 68%
rename from container/debian8-clang-fully-loaded/build.sh
rename to container/build.sh
index b8f2398..321180a 100755
--- a/container/debian8-clang-fully-loaded/build.sh
+++ b/container/build.sh
@@ -23,9 +23,10 @@
 Builds the fully-loaded container, with Google Cloud Container Builder or locally.
 
 Required parameters (when build with Google Cloud Container Builder):
+    -d|--distro             Distro of the base image: debian8, debian9, ubuntu16_04
     -p|--project            GCP project ID
-    -c|--container          docker container name
-    -t|--tag                docker tag for the image
+    -c|--container          Docker container name
+    -t|--tag                Docker tag for the image
     -b|--bucket             GCS bucket to store the tarball of debian packages
 
 Optional parameters (when build with Google Cloud Container Builder):
@@ -35,15 +36,15 @@
     -l|--local              build container locally
 
 To build with Google Cloud Container Builder:
-$ ./build.sh -p my-gcp-project -c debian8-clang-fully-loaded -t latest -b my_bucket
+$ ./build.sh -p my-gcp-project -d {debian8, debian9, ubuntu16_04} -c rbe-{debian8, debian9, ubuntu16_04} -t latest -b my_bucket
 will produce docker images in Google Container Registry:
-    gcr.io/my-gcp-project/debian8-clang-fully-loaded:{latest, clang_revision}
+    gcr.io/my-gcp-project/rbe-{debian8, debian9, ubuntu16_04}:latest
 and the debian packages installed will be packed as a tarball and stored in
 gs://my_bucket for future reference.
 
 To build locally:
-$ ./build.sh -l
-will produce docker locally as debian8-clang-fully-loaded:latest
+$ ./build.sh -d {debian8, debian9, ubuntu16_04} -l
+will produce docker locally as rbe-{debian8, debian9, ubuntu16_04}:latest
 EOF
 )
   echo "$usage"
@@ -62,6 +63,11 @@
         PROJECT=$1
         shift
         ;;
+      -d|--distro)
+        shift
+        DISTRO=$1
+        shift
+        ;;
       -c|--container)
         shift
         CONTAINER=$1
@@ -93,18 +99,28 @@
     esac
   done
 
-  if [[ ("$PROJECT" == "" || "$CONTAINER" == "" || "$TAG" == "" || "$BUCKET" == "" ) && "$LOCAL" == "" ]]; then
+  if [[ ("$PROJECT" == "" || "$CONTAINER" == "" || "$DISTRO" == "" || "$TAG" == "" || "$BUCKET" == "" ) && "$LOCAL" == "" ]]; then
      echo "Please specify all required options for building in Google Cloud Container Builder"
      show_usage
      exit 1
   fi
+
+  if [[ "$DISTRO" != "debian8" && "$DISTRO" != "debian9" && "$DISTRO" != "ubuntu16_04" ]]; then
+    echo "Distro parameter can be only: 'debian8', 'debian9' or 'ubuntu16_04'"
+    show_usage
+    exit 1
+  fi
 }
 
 main () {
   parse_parameters $@
 
   PROJECT_ROOT=$(git rev-parse --show-toplevel)
-  DIR="container/debian8-clang-fully-loaded"
+  if [[ "$DISTRO" == "debian8" ]]; then
+    DIR="container/rbe-${DISTRO}"
+  else
+    DIR="container/experimental/rbe-${DISTRO}"
+  fi
 
   # We need to start the build from the root of the project, so that we can
   # mount the full root directory (to use bazel builder properly).
@@ -114,14 +130,14 @@
 
   if [[ "$LOCAL" = true ]]; then
     echo "Building container locally."
-    bazel run //container/debian8-clang-fully-loaded:fl-toolchain
+    bazel run //${DIR}:toolchain
     echo "Testing container locally."
-    bazel test //container/debian8-clang-fully-loaded:fl-toolchain-test
+    bazel test //${DIR}:toolchain-test
     echo "Tagging container."
-    docker tag bazel/container/debian8-clang-fully-loaded:fl-toolchain debian8-clang-fully-loaded:latest
+    docker tag bazel/${DIR}:toolchain rbe-${DISTRO}:latest
     echo -e "\n" \
-      "debian8-clang-fully-loaded:lastest container is now available to use.\n" \
-      "To try it: docker run -it debian8-clang-fully-loaded:latest \n"
+      "rbe-${DISTRO}:lastest container is now available to use.\n" \
+      "To try it: docker run -it rbe-${DISTRO}:latest \n"
   else
     echo "Building container in Google Cloud Container Builder."
     # Setup GCP project id for the build
@@ -132,8 +148,8 @@
     find ${PROJECT_ROOT}/third_party -type f -print0 | xargs -0 chmod 644
     # Start Google Cloud Container Builder
     gcloud container builds submit . \
-      --config=${PROJECT_ROOT}/container/debian8-clang-fully-loaded/cloudbuild.yaml \
-      --substitutions _PROJECT=${PROJECT},_CONTAINER=${CONTAINER},_TAG=${TAG},_DIR=${DIR},_BUCKET=${BUCKET} \
+      --config=${PROJECT_ROOT}/container/cloudbuild.yaml \
+      --substitutions _PROJECT=${PROJECT},_DISTRO=${DISTRO},_CONTAINER=${CONTAINER},_TAG=${TAG},_DIR=${DIR},_BUCKET=${BUCKET} \
       ${ASYNC}
   fi
 }
diff --git a/container/debian8-clang-fully-loaded/cloudbuild.yaml b/container/cloudbuild.yaml
similarity index 78%
rename from container/debian8-clang-fully-loaded/cloudbuild.yaml
rename to container/cloudbuild.yaml
index 535162a..23b08c4 100644
--- a/container/debian8-clang-fully-loaded/cloudbuild.yaml
+++ b/container/cloudbuild.yaml
@@ -19,29 +19,29 @@
   - name: 'gcr.io/cloud-builders/bazel'
     # Set Bazel output_base to /workspace, which is a mounted directory on Google Cloud Builder.
     # This is to make sure Bazel generated files can be accessed by multiple containers.
-    args: ['--output_base=/workspace', 'run' , '--verbose_failures', '--spawn_strategy=standalone', '--genrule_strategy=standalone', '//${_DIR}:fl-toolchain']
-    id: 'fl-container'
+    args: ['--output_base=/workspace', 'run' , '--verbose_failures', '--spawn_strategy=standalone', '--genrule_strategy=standalone', '//${_DIR}:toolchain']
+    id: 'container-build'
     waitFor:
     - "-" # wait for nothing - start immediately
 
 # Step: re-tag the image
   - name: gcr.io/cloud-builders/docker
-    args: ['tag', 'bazel/${_DIR}:fl-toolchain', 'gcr.io/${_PROJECT}/${_CONTAINER}:${_TAG}']
-    id: 'fl-container-tag'
+    args: ['tag', 'bazel/${_DIR}:toolchain', 'gcr.io/${_PROJECT}/${_CONTAINER}:${_TAG}']
+    id: 'container-tag'
     waitFor: # wait for all artifacts to be ready
-    - 'fl-container'
+    - 'container-build'
 
 # Step: test the image
   - name: gcr.io/gcp-runtimes/structure_test
     args: [
     '--image', 'gcr.io/${_PROJECT}/${_CONTAINER}:${_TAG}',
-    '--config', '/workspace/container/test/rbe-debian8.yaml']
+    '--config', '/workspace/container/test/rbe-${_DISTRO}.yaml']
 
 # Step: store the tarball of debian packages in GCS
   - name: gcr.io/cloud-builders/gsutil
     args: ['cp',
-           '/workspace/bazel-out/k8-fastbuild/bin/container/debian8-clang-fully-loaded/fl-toolchain-packages.tar',
-           'gs://${_BUCKET}/fl-toolchain-packages-${_TAG}.tar'
+           '/workspace/bazel-out/k8-fastbuild/bin/${_DIR}/toolchain-packages.tar',
+           'gs://${_BUCKET}/${_CONTAINER}-${_TAG}.tar'
     ]
 
 # Build the release-container
diff --git a/container/experimental/rbe-debian8/BUILD b/container/experimental/rbe-debian8/BUILD
index 92b0437..9014051 100644
--- a/container/experimental/rbe-debian8/BUILD
+++ b/container/experimental/rbe-debian8/BUILD
@@ -38,7 +38,7 @@
 )
 
 container_image(
-    name = "fl-toolchain",
+    name = "toolchain",
     base = "@debian8//image",
     layers = [
         "base-ltl",
@@ -107,7 +107,7 @@
 )
 
 container_test(
-    name = "fl-toolchain-test",
+    name = "toolchain-test",
     configs = ["//container/test:rbe-debian8.yaml"],
-    image = ":fl-toolchain",
+    image = ":toolchain",
 )
diff --git a/container/debian8-clang-fully-loaded/BUILD b/container/experimental/rbe-debian9/BUILD
similarity index 85%
copy from container/debian8-clang-fully-loaded/BUILD
copy to container/experimental/rbe-debian9/BUILD
index 2bd3b57..6198cac 100644
--- a/container/debian8-clang-fully-loaded/BUILD
+++ b/container/experimental/rbe-debian9/BUILD
@@ -25,8 +25,8 @@
 load("@io_bazel_rules_docker//contrib:test.bzl", "container_test")
 
 toolchain_container(
-    name = "fl-toolchain",
-    base = "@debian8//image",
+    name = "toolchain",
+    base = "@debian9//image",
     env = {
         # PATH envvar is a special case, and currently only the one in the
         # topmost layer is set. So that we override it here to include all.
@@ -43,7 +43,7 @@
 
 language_tool_layer(
     name = "base-ltl",
-    base = "@debian8//image",
+    base = "@debian9//image",
     packages = [
         "binutils",
         "ca-certificates",
@@ -52,28 +52,28 @@
         "file",
         "git",
         "openssh-client",
+        "unzip",
         "wget",
         "zip",
-        "unzip",
     ],
 )
 
 language_tool_layer(
     name = "clang-ltl",
-    base = "@debian8//image",
+    base = "@debian9//image",
     env = {
         "CC": "/usr/local/bin/clang",
         "ASAN_SYMBOLIZER_PATH": "/usr/local/bin/llvm-symbolizer",
     },
-    tars = ["//third_party/clang:tar"],
     packages = [
-        "libstdc++-4.9-dev",
+        "libstdc++-6-dev",
     ],
+    tars = ["//third_party/clang:tar"],
 )
 
 language_tool_layer(
     name = "go-ltl",
-    base = "@debian8//image",
+    base = "@debian9//image",
     env = {
         "GOPATH": "/go",
         "PATH": "$PATH:/usr/local/go/bin",
@@ -83,36 +83,31 @@
 
 language_tool_layer(
     name = "java-ltl",
-    base = "@debian8//image",
+    additional_repos = [
+        "deb http://deb.debian.org/debian stretch-backports main",
+    ],
+    base = "@debian9//image",
     env = {
         "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64",
     },
+    installation_cleanup_commands = cleanup_commands()["java"],
+    packages = [
+        "ca-certificates-java",
+        "openjdk-8-jdk-headless",
+        "openjdk-8-jre-headless",
+    ],
     symlinks = {
         "/usr/bin/java": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java",
     },
-    packages = [
-        "openjdk-8-jdk-headless",
-        "openjdk-8-jre-headless",
-        "ca-certificates-java=20161107'*'",
-    ],
-    additional_repos = [
-        "deb http://deb.debian.org/debian jessie-backports main",
-    ],
-    installation_cleanup_commands = cleanup_commands()["java"],
 )
 
 language_tool_layer(
     name = "python-ltl",
-    base = "@debian8//image",
+    base = "@debian9//image",
     env = {
         "PATH": "$PATH:/opt/python3.6/bin",
     },
-    symlinks = {
-        "/usr/bin/python": "/usr/bin/python2.7",
-        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
-        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
-    },
-    tars = ["//third_party/python:tar"],
+    installation_cleanup_commands = cleanup_commands()["python"],
     packages = [
         "python-dev",
         "python-numpy",
@@ -121,11 +116,19 @@
         "python3-numpy",
         "python3-pip",
     ],
-    installation_cleanup_commands = cleanup_commands()["python"],
+    symlinks = {
+        "/usr/bin/python": "/usr/bin/python2.7",
+        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
+        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
+    },
+    tars = ["//third_party/python:tar"],
 )
 
 container_test(
-    name = "fl-toolchain-test",
-    configs = ["//container/test:rbe-debian8.yaml"],
-    image = ":fl-toolchain",
+    name = "toolchain-test",
+    configs = [
+        "//container/test:common.yaml",
+        "//container/test:rbe-debian9.yaml",
+    ],
+    image = ":toolchain",
 )
diff --git a/container/debian8-clang-fully-loaded/BUILD b/container/experimental/rbe-ubuntu16_04/BUILD
similarity index 86%
copy from container/debian8-clang-fully-loaded/BUILD
copy to container/experimental/rbe-ubuntu16_04/BUILD
index 2bd3b57..1e420d6 100644
--- a/container/debian8-clang-fully-loaded/BUILD
+++ b/container/experimental/rbe-ubuntu16_04/BUILD
@@ -25,8 +25,8 @@
 load("@io_bazel_rules_docker//contrib:test.bzl", "container_test")
 
 toolchain_container(
-    name = "fl-toolchain",
-    base = "@debian8//image",
+    name = "toolchain",
+    base = "@ubuntu16_04//image",
     env = {
         # PATH envvar is a special case, and currently only the one in the
         # topmost layer is set. So that we override it here to include all.
@@ -43,7 +43,7 @@
 
 language_tool_layer(
     name = "base-ltl",
-    base = "@debian8//image",
+    base = "@ubuntu16_04//image",
     packages = [
         "binutils",
         "ca-certificates",
@@ -52,28 +52,28 @@
         "file",
         "git",
         "openssh-client",
+        "unzip",
         "wget",
         "zip",
-        "unzip",
     ],
 )
 
 language_tool_layer(
     name = "clang-ltl",
-    base = "@debian8//image",
+    base = "@ubuntu16_04//image",
     env = {
         "CC": "/usr/local/bin/clang",
         "ASAN_SYMBOLIZER_PATH": "/usr/local/bin/llvm-symbolizer",
     },
-    tars = ["//third_party/clang:tar"],
     packages = [
         "libstdc++-4.9-dev",
     ],
+    tars = ["//third_party/clang:tar"],
 )
 
 language_tool_layer(
     name = "go-ltl",
-    base = "@debian8//image",
+    base = "@ubuntu16_04//image",
     env = {
         "GOPATH": "/go",
         "PATH": "$PATH:/usr/local/go/bin",
@@ -83,36 +83,28 @@
 
 language_tool_layer(
     name = "java-ltl",
-    base = "@debian8//image",
+    base = "@ubuntu16_04//image",
     env = {
         "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64",
     },
+    installation_cleanup_commands = cleanup_commands()["java"],
+    packages = [
+        "ca-certificates-java",
+        "openjdk-8-jdk-headless",
+        "openjdk-8-jre-headless",
+    ],
     symlinks = {
         "/usr/bin/java": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java",
     },
-    packages = [
-        "openjdk-8-jdk-headless",
-        "openjdk-8-jre-headless",
-        "ca-certificates-java=20161107'*'",
-    ],
-    additional_repos = [
-        "deb http://deb.debian.org/debian jessie-backports main",
-    ],
-    installation_cleanup_commands = cleanup_commands()["java"],
 )
 
 language_tool_layer(
     name = "python-ltl",
-    base = "@debian8//image",
+    base = "@ubuntu16_04//image",
     env = {
         "PATH": "$PATH:/opt/python3.6/bin",
     },
-    symlinks = {
-        "/usr/bin/python": "/usr/bin/python2.7",
-        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
-        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
-    },
-    tars = ["//third_party/python:tar"],
+    installation_cleanup_commands = cleanup_commands()["python"],
     packages = [
         "python-dev",
         "python-numpy",
@@ -121,11 +113,19 @@
         "python3-numpy",
         "python3-pip",
     ],
-    installation_cleanup_commands = cleanup_commands()["python"],
+    symlinks = {
+        "/usr/bin/python": "/usr/bin/python2.7",
+        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
+        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
+    },
+    tars = ["//third_party/python:tar"],
 )
 
 container_test(
-    name = "fl-toolchain-test",
-    configs = ["//container/test:rbe-debian8.yaml"],
-    image = ":fl-toolchain",
+    name = "toolchain-test",
+    configs = [
+        "//container/test:common.yaml",
+        "//container/test:rbe-ubuntu16_04.yaml",
+    ],
+    image = ":toolchain",
 )
diff --git a/container/debian8-clang-fully-loaded/BUILD b/container/rbe-debian8/BUILD
similarity index 94%
rename from container/debian8-clang-fully-loaded/BUILD
rename to container/rbe-debian8/BUILD
index 2bd3b57..465b1c1 100644
--- a/container/debian8-clang-fully-loaded/BUILD
+++ b/container/rbe-debian8/BUILD
@@ -25,7 +25,7 @@
 load("@io_bazel_rules_docker//contrib:test.bzl", "container_test")
 
 toolchain_container(
-    name = "fl-toolchain",
+    name = "toolchain",
     base = "@debian8//image",
     env = {
         # PATH envvar is a special case, and currently only the one in the
@@ -52,9 +52,9 @@
         "file",
         "git",
         "openssh-client",
+        "unzip",
         "wget",
         "zip",
-        "unzip",
     ],
 )
 
@@ -65,10 +65,10 @@
         "CC": "/usr/local/bin/clang",
         "ASAN_SYMBOLIZER_PATH": "/usr/local/bin/llvm-symbolizer",
     },
-    tars = ["//third_party/clang:tar"],
     packages = [
         "libstdc++-4.9-dev",
     ],
+    tars = ["//third_party/clang:tar"],
 )
 
 language_tool_layer(
@@ -83,22 +83,22 @@
 
 language_tool_layer(
     name = "java-ltl",
+    additional_repos = [
+        "deb http://deb.debian.org/debian jessie-backports main",
+    ],
     base = "@debian8//image",
     env = {
         "JAVA_HOME": "/usr/lib/jvm/java-8-openjdk-amd64",
     },
+    installation_cleanup_commands = cleanup_commands()["java"],
+    packages = [
+        "ca-certificates-java=20161107'*'",
+        "openjdk-8-jdk-headless",
+        "openjdk-8-jre-headless",
+    ],
     symlinks = {
         "/usr/bin/java": "/usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java",
     },
-    packages = [
-        "openjdk-8-jdk-headless",
-        "openjdk-8-jre-headless",
-        "ca-certificates-java=20161107'*'",
-    ],
-    additional_repos = [
-        "deb http://deb.debian.org/debian jessie-backports main",
-    ],
-    installation_cleanup_commands = cleanup_commands()["java"],
 )
 
 language_tool_layer(
@@ -107,12 +107,7 @@
     env = {
         "PATH": "$PATH:/opt/python3.6/bin",
     },
-    symlinks = {
-        "/usr/bin/python": "/usr/bin/python2.7",
-        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
-        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
-    },
-    tars = ["//third_party/python:tar"],
+    installation_cleanup_commands = cleanup_commands()["python"],
     packages = [
         "python-dev",
         "python-numpy",
@@ -121,11 +116,19 @@
         "python3-numpy",
         "python3-pip",
     ],
-    installation_cleanup_commands = cleanup_commands()["python"],
+    symlinks = {
+        "/usr/bin/python": "/usr/bin/python2.7",
+        "/opt/python3.6/bin/python3": "/opt/python3.6/bin/python3.6",
+        "/opt/python3.6/bin/pip3": "/opt/python3.6/bin/pip3.6",
+    },
+    tars = ["//third_party/python:tar"],
 )
 
 container_test(
-    name = "fl-toolchain-test",
-    configs = ["//container/test:rbe-debian8.yaml"],
-    image = ":fl-toolchain",
+    name = "toolchain-test",
+    configs = [
+        "//container/test:common.yaml",
+        "//container/test:rbe-debian8.yaml",
+    ],
+    image = ":toolchain",
 )
diff --git a/container/test/common.yaml b/container/test/common.yaml
new file mode 100644
index 0000000..eb7943c
--- /dev/null
+++ b/container/test/common.yaml
@@ -0,0 +1,125 @@
+schemaVersion: "1.0.0"
+
+commandTests:
+- name: 'path-envvar'
+  command: ['sh', '-c', 'echo $PATH']
+  expectedOutput: ['/opt/python3.6/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
+- name: 'cc-envvar'
+  command: ['sh', '-c', 'echo $CC']
+  expectedOutput: ['/usr/local/bin/clang']
+- name: 'javahome-envvar'
+  command: ['sh', '-c', 'echo $JAVA_HOME']
+  expectedOutput: ['/usr/lib/jvm/java-8-openjdk-amd64']
+- name: 'gopath-envvar'
+  command: ['sh', '-c', 'echo $GOPATH']
+  expectedOutput: ['/go']
+- name: 'clang-version'
+  command: ['bash', '-c', 'clang --version']
+  expectedOutput: ['clang version 7.0.0.*']
+- name: 'java-version'
+  command: ['bash', '-c', 'java -version 2>&1']
+  expectedOutput: ['openjdk version \"1.8.*']
+- name: 'python2-version'
+  command: ['bash', '-c', 'python -V 2>&1']
+  expectedOutput: ['Python 2.7.*']
+- name: 'python3-version'
+  command: ['bash', '-c', 'python3 -V']
+  expectedOutput: ['Python 3.6.2']
+- name: 'go-version'
+  command: ['bash', '-c', 'go version']
+  expectedOutput: ['go version go1.10 linux/amd64']
+- name: 'check-curl'
+  command: ['bash', '-c', 'curl --version']
+  expectedOutput: ['curl .* \(x86_64-pc-linux-gnu\).*']
+- name: 'check-ed'
+  command: ['bash', '-c', 'ed --version']
+  expectedOutput: ['GNU Ed .*']
+- name: 'check-file'
+  command: ['bash', '-c', 'file --version']
+  expectedOutput: ['file-.*']
+- name: 'check-git'
+  command: ['bash', '-c', 'git --version']
+  expectedOutput: ['git version .*']
+- name: 'check-openssl'
+  command: ['bash', '-c', 'openssl version']
+  expectedOutput: ['OpenSSL .*']
+- name: 'check-wget'
+  command: ['bash', '-c', 'wget --version']
+  expectedOutput: ['GNU Wget.* built on linux-gnu.*']
+- name: 'check-zip'
+  command: ['bash', '-c', 'zip --version']
+  expectedOutput: ['.*This is Zip.*']
+
+fileExistenceTests:
+- name: 'Root'
+  isDirectory: true
+  path: '/'
+  shouldExist: true
+- name: 'Clang'
+  isDirectory: false
+  path: '/usr/local/bin/clang'
+  shouldExist: true
+- name: 'OpenJDK'
+  isDirectory: true
+  path: '/usr/lib/jvm/java-8-openjdk-amd64'
+  shouldExist: true
+- name: 'Python2'
+  isDirectory: false
+  path: '/usr/bin/python2.7'
+  shouldExist: true
+- name: 'Python3'
+  isDirectory: false
+  path: '/opt/python3.6/bin/python3'
+  shouldExist: true
+- name: 'Golang'
+  isDirectory: false
+  path: '/usr/local/go/bin/go'
+  shouldExist: true
+- name: 'sanitizer'
+  isDirectory: true
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer'
+  shouldExist: true
+- name: 'sanitizer-allocator'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/allocator_interface.h'
+  shouldExist: true
+- name: 'sanitizer-asan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/asan_interface.h'
+  shouldExist: true
+- name: 'sanitizer-common_defs'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/common_interface_defs.h'
+  shouldExist: true
+- name: 'sanitizer-coverage'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/coverage_interface.h'
+  shouldExist: true
+- name: 'sanitizer-dfsan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/dfsan_interface.h'
+  shouldExist: true
+- name: 'sanitizer-esan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/esan_interface.h'
+  shouldExist: true
+- name: 'sanitizer-linux_syscall_hooks'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/linux_syscall_hooks.h'
+  shouldExist: true
+- name: 'sanitizer-lsan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/lsan_interface.h'
+  shouldExist: true
+- name: 'sanitizer-msan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/msan_interface.h'
+  shouldExist: true
+- name: 'sanitizer-tsan_atomic'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface_atomic.h'
+  shouldExist: true
+- name: 'sanitizer-tsan'
+  isDirectory: false
+  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface.h'
+  shouldExist: true
diff --git a/container/test/rbe-debian8.yaml b/container/test/rbe-debian8.yaml
index 5347b49..5184d98 100644
--- a/container/test/rbe-debian8.yaml
+++ b/container/test/rbe-debian8.yaml
@@ -1,125 +1,6 @@
 schemaVersion: "1.0.0"
 
 commandTests:
-- name: 'path-envvar'
-  command: ['sh', '-c', 'echo $PATH']
-  expectedOutput: ['/opt/python3.6/bin:/usr/local/go/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin']
-- name: 'cc-envvar'
-  command: ['sh', '-c', 'echo $CC']
-  expectedOutput: ['/usr/local/bin/clang']
-- name: 'javahome-envvar'
-  command: ['sh', '-c', 'echo $JAVA_HOME']
-  expectedOutput: ['/usr/lib/jvm/java-8-openjdk-amd64']
-- name: 'gopath-envvar'
-  command: ['sh', '-c', 'echo $GOPATH']
-  expectedOutput: ['/go']
-- name: 'clang-version'
-  command: ['bash', '-c', 'clang --version']
-  expectedOutput: ['clang version 7.0.0.*']
-- name: 'java-version'
-  command: ['bash', '-c', 'java -version 2>&1']
-  expectedOutput: ['openjdk version \"1.8.*']
-- name: 'python2-version'
-  command: ['bash', '-c', 'python -V 2>&1']
-  expectedOutput: ['Python 2.7.9']
-- name: 'python3-version'
-  command: ['bash', '-c', 'python3 -V']
-  expectedOutput: ['Python 3.6.2']
-- name: 'go-version'
-  command: ['bash', '-c', 'go version']
-  expectedOutput: ['go version go1.10 linux/amd64']
-- name: 'check-curl'
-  command: ['bash', '-c', 'curl --version']
-  expectedOutput: ['curl .* \(x86_64-pc-linux-gnu\).*']
-- name: 'check-ed'
-  command: ['bash', '-c', 'ed --version']
-  expectedOutput: ['GNU Ed .*']
-- name: 'check-file'
-  command: ['bash', '-c', 'file --version']
-  expectedOutput: ['file-.*']
-- name: 'check-git'
-  command: ['bash', '-c', 'git --version']
-  expectedOutput: ['git version .*']
-- name: 'check-openssl'
-  command: ['bash', '-c', 'openssl version']
-  expectedOutput: ['OpenSSL .*']
-- name: 'check-wget'
-  command: ['bash', '-c', 'wget --version']
-  expectedOutput: ['GNU Wget.* built on linux-gnu.*']
-- name: 'check-zip'
-  command: ['bash', '-c', 'zip --version']
-  expectedOutput: ['.*This is Zip.*']
-
-fileExistenceTests:
-- name: 'Root'
-  isDirectory: true
-  path: '/'
-  shouldExist: true
-- name: 'Clang'
-  isDirectory: false
-  path: '/usr/local/bin/clang'
-  shouldExist: true
-- name: 'OpenJDK'
-  isDirectory: true
-  path: '/usr/lib/jvm/java-8-openjdk-amd64'
-  shouldExist: true
-- name: 'Python2'
-  isDirectory: false
-  path: '/usr/bin/python2.7'
-  shouldExist: true
-- name: 'Python3'
-  isDirectory: false
-  path: '/opt/python3.6/bin/python3'
-  shouldExist: true
-- name: 'Golang'
-  isDirectory: false
-  path: '/usr/local/go/bin/go'
-  shouldExist: true
-- name: 'sanitizer'
-  isDirectory: true
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer'
-  shouldExist: true
-- name: 'sanitizer-allocator'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/allocator_interface.h'
-  shouldExist: true
-- name: 'sanitizer-asan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/asan_interface.h'
-  shouldExist: true
-- name: 'sanitizer-common_defs'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/common_interface_defs.h'
-  shouldExist: true
-- name: 'sanitizer-coverage'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/coverage_interface.h'
-  shouldExist: true
-- name: 'sanitizer-dfsan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/dfsan_interface.h'
-  shouldExist: true
-- name: 'sanitizer-esan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/esan_interface.h'
-  shouldExist: true
-- name: 'sanitizer-linux_syscall_hooks'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/linux_syscall_hooks.h'
-  shouldExist: true
-- name: 'sanitizer-lsan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/lsan_interface.h'
-  shouldExist: true
-- name: 'sanitizer-msan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/msan_interface.h'
-  shouldExist: true
-- name: 'sanitizer-tsan_atomic'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface_atomic.h'
-  shouldExist: true
-- name: 'sanitizer-tsan'
-  isDirectory: false
-  path: '/usr/local/lib/clang/7.0.0/include/sanitizer/tsan_interface.h'
-  shouldExist: true
+- name: 'os-version'
+  command: ['sh', '-c', 'cat /etc/issue.net']
+  expectedOutput: ['Debian GNU/Linux 8']
diff --git a/container/test/rbe-debian9.yaml b/container/test/rbe-debian9.yaml
new file mode 100644
index 0000000..3f97c6b
--- /dev/null
+++ b/container/test/rbe-debian9.yaml
@@ -0,0 +1,6 @@
+schemaVersion: "1.0.0"
+
+commandTests:
+- name: 'os-version'
+  command: ['sh', '-c', 'cat /etc/issue.net']
+  expectedOutput: ['Debian GNU/Linux 9']
diff --git a/container/test/rbe-ubuntu16_04.yaml b/container/test/rbe-ubuntu16_04.yaml
new file mode 100644
index 0000000..41eb4d2
--- /dev/null
+++ b/container/test/rbe-ubuntu16_04.yaml
@@ -0,0 +1,6 @@
+schemaVersion: "1.0.0"
+
+commandTests:
+- name: 'os-version'
+  command: ['sh', '-c', 'cat /etc/issue.net']
+  expectedOutput: ['Ubuntu 16.04.3 LTS']