Brought in changes from https://github.com/dotcloud/docker-py/pull/145
From 4bc5d27e51
4bc5d27e51
From 9dc03c5737
9dc03c5737