THRIFT-4351: use travis build stages to optimize build,
avoiding duplicate rebuilds of the same image, and also
allow personal docker hub repositories for private fork
builds to be optimized. Move ubsan build to artful image
because it catches more stuff and fix what was found.

THRIFT-4345: solidify docker build strategy for maximum
coverage: trusty, xenial, artful as stock as they can be

THRIFT-4344: add top level language summary markdown and
update readme with a new image on the layered architecture

THRIFT-3847: remove VERSION macro from config.h which
was causing a conflict on artful builds.

THRIFT-4359: fix haxe map/set decode when key is binary,
as a missing break statement caused it to use an int
during decode

This closes #1389
diff --git a/build/docker/README.md b/build/docker/README.md
index 2de7d68..81a4935 100644
--- a/build/docker/README.md
+++ b/build/docker/README.md
@@ -1,15 +1,40 @@
-# Apache Thrift Docker containers
+# Docker Integration #
 
-Docker containers used to build and test Apache Thrift for a variety of platforms.
+Due to the large number of language requirements to build Apache Thrift, docker containers are used to build and test the project on a variety of platforms to provide maximum test coverage.
 
-## Available Containers
+## Travis CI Integration ##
 
-The Travis CI (continuous integration) builds use the Ubuntu Trusty and Xenial images to maximize
-language level coverage.  The other images may or may not work for all languages.
+The Travis CI scripts use the following environment variables and logic to determine their behavior.
+
+### Environment Variables ###
+
+| Variable | Default | Usage |
+| -------- | ----- | ------- |
+| `DISTRO` | `ubuntu-xenial` | Set by various build jobs in `.travis.yml` to run builds in different containers.  Not intended to be set externally.|
+| `DOCKER_REPO` | `thrift` | The name of the Docker Hub repository to obtain and store docker images. |
+| `DOCKER_USER` | `apache` | The Docker Hub account name containing the repository. |
+| `DOCKER_PASS` | `<none>` | The Docker Hub account password to use when pushing new tags. |
+
+For example, the default docker image that is used in builds if no overrides are specified would be: `apache/thrift:ubuntu-xenial`
+
+If you have forked the Apache Thrift repository and you would like to use your own Docker Hub account to store thrift build images, you can use the Travis CI web interface to set the `DOCKER_USER`, `DOCKER_PASS`, and `DOCKER_REPO` variables in a secure manner.
+
+### Logic ###
+
+The Travis CI build runs in two phases - first the docker images are rebuilt for each of the three supported containers if they do not match the Dockerfile that was used to build the most recent tag.  If a `DOCKER_PASS` environment variable is specified, the docker stage builds will attempt to log into Docker Hub and push the resulting tags.
+
+## Supported Containers ##
+
+The Travis CI (continuous integration) builds use the Ubuntu Trusty, Xenial, and Artful images to maximize language level coverage.
 
 ### Ubuntu
-* trusty
-* xenial (current)
+* trusty (legacy)
+* xenial (stable)
+* artful (latest)
+
+## Unsupported Containers
+
+These containers may be in various states, and may not build everything.
 
 ### CentOS
 * 7.3
@@ -20,9 +45,6 @@
 * stretch
   * make check in lib/cpp fails due to https://svn.boost.org/trac10/ticket/12507
 
-## Dependencies
-* A working Docker environment. A Vagrantfile is provided which will setup an Ubuntu host and working Docker environment as well as build the Apache Thrift Docker container for testing and development.
-
 ## Usage
 From the Apache Thrift code base root:
 
@@ -30,58 +52,56 @@
 
 	docker build -t thrift build/docker/ubuntu-xenial
 
-	or
-
-	docker build -t thrift build/docker/centos-7.3
-
 * Run
 
 	docker run -v $(pwd):/thrift/src -it thrift /bin/bash
 
 ## Core Tool Versions per Dockerfile
-| Tool      | centos-7.3 | debian-stretch | ubuntu-trusty | ubuntu-xenial | Notes |
-| :-------- | :--------- | :------------- | :------------ | :------------ | :---- |
-| ant       | 1.9.2      | 1.9.9          | 1.9.3         | 1.9.6         |       |
-| autoconf  | 2.69       | 2.69           | 2.69          | 2.69          |       |
-| automake  | 1.13.4     | 1.15           | 1.14.1        | 1.15          |       |
-| bison     | 2.7        | 3.0.4          | 3.0.2         | 3.0.4         |       |
-| boost     | 1.53.0     | 1.62.0         | 1.54.0        | 1.58.0        |       |
-| cmake     | 3.6.3      | 3.7.2          | 3.2.2         | 3.5.1         |       |
-| flex      | 2.5.37     | 2.6.1          | 2.5.35        | 2.6.0         |       |
-| glibc     | 2.17       | 2.24           | 2.19          | 2.23          |       |
-| libevent  | 2.0.21     | 2.0.21         | 2.0.21        | 2.0.21        |       |
-| libstdc++ | 4.8.5      | 6.3.0          | 4.8.4         | 5.4.0         |       |
-| make      | 3.82       | 4.1            | 3.81          | 4.1           |       |
-| openssl   | 1.0.1e     | 1.1.0f         | 1.0.1f        | 1.0.2g        |       |
+| Tool      | ubuntu-trusty | ubuntu-xenial | ubuntu-artful | Notes |
+| :-------- | :------------ | :------------ | :------------ | :---- |
+| ant       | 1.9.3         | 1.9.6         | 1.9.9         |       |
+| autoconf  | 2.69          | 2.69          | 2.69          |       |
+| automake  | 1.14.1        | 1.15          | 1.15          |       |
+| bison     | 3.0.2         | 3.0.4         | 3.0.4         |       |
+| boost     | 1.54.0        | 1.58.0        | 1.63.0        | artful: stock boost 1.62.0 has problems running unit tests |
+| cmake     | 3.2.2         | 3.5.1         | 3.9.1         |       |
+| cppcheck  | 1.61          | 1.72          | 1.80          |       |
+| flex      | 2.5.35        | 2.6.0         | 2.6.1         |       |
+| glibc     | 2.19          | 2.23          | 2.26          |       |
+| libevent  | 2.0.21        | 2.0.21        | 2.1           |       |
+| libstdc++ | 4.8.4         | 5.4.0         | 7.2.0         |       |
+| make      | 3.81          | 4.1           | 4.1           |       |
+| openssl   | 1.0.1f        | 1.0.2g        | 1.0.2g        |       |
+| qt5       | 5.2.1         | 5.5.1         | 5.9.1         |       |
 
-## Language Versions per Dockerfile
-| Language  | centos-7.3 | debian-stretch | ubuntu-trusty | ubuntu-xenial | Notes |
-| :-------- | :--------- | :------------- | :------------ | :------------ | :---- |
-| as3       |            |                |               |               | Not in CI |
-| C++-gcc   | 4.8.5      | 6.3.0          | 4.8.4         | 5.4.0         |       |
-| C++-clang | 3.4.2      | 3.8.1          | 3.4           | 3.8           |       |
-| C# (mono) | 4.6.2      | 4.6.2.7        | 5.2.0.224     | 5.2.0.215     |       |
-| c_glib    | 2.46.2     | 2.50.3         | 2.40.2        | 2.48.2        |       |
-| cocoa     |            |                |               |               | Not in CI |
-| d         | 2.076.0    | 2.076.0        | 2.070.0       | 2.075.1       |       |
-| dart      | 1.24.2     | 1.24.2         | 1.24.2        | 1.24.2        |       |
-| delphi    |            |                |               |               | Not in CI |
-| dotnet    |            |                |               |               | Not in CI |
-| erlang    | 20         | 19.2           | 20            | 18.3          |       |
-| go        | 1.9        | 1.7.4          | 1.4.3         | 1.6.2         |       |
-| haskell   | 7.6.3      | 8.0.1          | 7.6.3         | 7.10.3        |       |
-| haxe      |            | 3.2.1          | 3.2.1         | 3.2.1         |       |
-| java      | 1.8.0_141  | 1.8.0_141      | 1.7.0_151     | 1.8.0_131     |       |
-| js        |            |                |               |               | Unsure how to look for version info |
-| lua       | 5.3.4      | 5.2.4          | 5.2.3         | 5.2.4         |       |
-| nodejs    | 6.11.1     | 8.4.0          | 4.8.4         | 7.10.1        | Node 8.5 broke copyFile and jsdoc |
-| ocaml     | 4.01.0     | 4.02.3         | 4.02.3        | 4.02.3        |       |
-| perl      | 5.16.3     | 5.24.1         | 5.18.2        | 5.22.1        |       |
-| php       | 5.4.16     | 7.0.19         | 5.5.9         | 7.0.22        |       |
-| python    | 2.7.5      | 2.7.13         | 2.7.6         | 2.7.12        |       |
-| python3   | 3.4.5      | 3.5.3          | 3.4.3         | 3.5.2         |       |
-| ruby      | 2.0.0p648  | 2.3.3p222      | 1.9.3p484     | 2.3.1p112     |       |
-| rust      | 1.17.0     | 1.14.0         | 1.17.0        | 1.15.1        | Rust is too old on stretch |
-| smalltalk |            |                |               |               | Not in CI |
-| swift     |            |                |               |               | Not in CI |
+## Compiler/Language Versions per Dockerfile
+| Language  | ubuntu-trusty | ubuntu-xenial | ubuntu-artful | Notes |
+| :-------- | :------------ | :------------ | :------------ | :---- |
+| as3       |               |               |               | Not in CI |
+| C++ gcc   | 4.8.4         | 5.4.0         | 7.2.0         |       |
+| C++ clang | 3.4           | 3.8           | 4.0           |       |
+| C# (mono) | 3.2.8.0       | 4.2.1         | 4.6.2.7       |       |
+| c_glib    | 2.40.2        | 2.48.2        | 2.54.0        |       |
+| cocoa     |               |               |               | Not in CI |
+| d         | 2.070.2       | 2.073.2       | 2.076.0       |       |
+| dart      | 1.20.1        | 1.24.2        |               | artful: apt repo not compatible with apt 1.4? |
+| delphi    |               |               |               | Not in CI |
+| dotnet    |               | 2.0.0         |               | Needs to be added to artful |
+| erlang    | R16B03        | 18.3          | 20.0.4        |       |
+| go        | 1.2.1         | 1.6.2         | 1.8.3         |       |
+| haskell   | 7.6.3         | 7.10.3        | 8.0.2         |       |
+| haxe      |               | 3.2.1         | 3.4.2         | disabled in trusty builds - cores on install v3.0.0, disabled in artful builds - see THRIFT-4352 |
+| java      | 1.7.0_151     | 1.8.0_131     | 1.8.0_144     |       |
+| js        |               |               |               | Unsure how to look for version info? |
+| lua       | 5.1.5         | 5.2.4         | 5.3.3         |       |
+| nodejs    |               | 4.2.6         | 6.11.2        | trusty has node.js 0.10.0 which is too old |
+| ocaml     |               | 4.02.3        | 4.04.0        |       |
+| perl      | 5.18.2        | 5.22.1        | 5.26.0        |       |
+| php       | 5.5.9         | 7.0.22        | 7.1.8         |       |
+| python    | 2.7.6         | 2.7.12        | 2.7.14        |       |
+| python3   | 3.4.3         | 3.5.2         | 3.6.3         |       |
+| ruby      | 1.9.3p484     | 2.3.1p112     | 2.3.3p222     |       |
+| rust      | 1.15.1        | 1.15.1        | 1.18.0        |       |
+| smalltalk |               |               |               | Not in CI |
+| swift     |               |               |               | Not in CI |