Do some forward porting of the old work of
mitchellh/packer's docker branch. #774