Docker create (rebase of 6907)

Closes #6907

Ping @vieux @unclejack @crosbymichael
Does anybody find the code harder to read with the cidFile struct like @LK4D4 finds it? If so, I'm happy to inline the methods and remove the struct.