redmine6445: Mark's support for docker and rewrite of container promises

This is the portion of @markburgess's development branch that deals with docker and containers, as reindented and rebased onto master by @ediosyncratic.