implemented https://github.com/jpetazzo/docker/commit/9f1c9686e0ee47289adeeedd6cf8d5296a058463