Update WORKSPACE file to use newer dependencies

For whatever reason, something has changed in bazel and the existing
versions of rules_docker in use (v0.5.1) no-longer works.

Equally, 'distroless' dpkg_src and dpkg_list now need to be imported
differently.

This change updates rules_docker to 0.8.0, and updates the workspace
file to deal with the changes both in rules_docker and the distroless
packages.

It also adds the .bazelrc file from the rules_docker repository to force
support for python2 toolchains.
See: https://github.com/bazelbuild/bazel/issues/7899

Change-Id: Iaf7a8205d2003246d74e44bad92313e5d390164c
Signed-off-by: David Gow <davidgow@google.com>
diff --git a/.bazelrc b/.bazelrc
new file mode 100644
index 0000000..5ef508c
--- /dev/null
+++ b/.bazelrc
@@ -0,0 +1,25 @@
+# Copyright 2017 The Bazel Authors. All rights reserved.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#    http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# NOTE(davidgow): This file originally comes from:
+# https://github.com/bazelbuild/rules_docker/blob/835d20b7272e214b4449b88b6154cfea3544ec99/.bazelrc
+
+# The following flags are set to test use of new features for python toolchains
+# These flags will only work with Bazel 0.25.0 or above.
+build --incompatible_use_python_toolchains
+build --host_force_python=PY2
+test --incompatible_use_python_toolchains
+test --host_force_python=PY2
+run --incompatible_use_python_toolchains
+run --host_force_python=PY2
diff --git a/WORKSPACE b/WORKSPACE
index 9c92879..7d7dd23 100644
--- a/WORKSPACE
+++ b/WORKSPACE
@@ -10,9 +10,9 @@
 # import container build/push rules
 http_archive(
     name = "io_bazel_rules_docker",
-    sha256 = "29d109605e0d6f9c892584f07275b8c9260803bf0c6fcb7de2623b2bedc910bd",
-    strip_prefix = "rules_docker-0.5.1",
-    urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.5.1.tar.gz"],
+    sha256 = "3556d4972571f288f8c43378295d84ed64fef5b1a875211ee1046f9f6b4258fa",
+    strip_prefix = "rules_docker-0.8.0",
+    urls = ["https://github.com/bazelbuild/rules_docker/archive/v0.8.0.tar.gz"],
 )
 
 # pull latest kunitconfig
@@ -44,13 +44,17 @@
 
 # setting container rules / base images needed
 load(
-    "@io_bazel_rules_docker//container:container.bzl",
-    "container_pull",
+    "@io_bazel_rules_docker//repositories:repositories.bzl",
     container_repositories = "repositories",
 )
 
 container_repositories()
 
+load(
+    "@io_bazel_rules_docker//container:container.bzl",
+    "container_pull",
+)
+
 container_pull(
     name = "debian_base",
     registry = "index.docker.io",
@@ -67,6 +71,10 @@
 load(
     "@distroless//package_manager:package_manager.bzl",
     "package_manager_repositories",
+)
+
+load(
+    "@distroless//package_manager:dpkg.bzl",
     "dpkg_src",
     "dpkg_list",
 )