Decomplicate consuming the output of docker commands in tests.

Note only last commit is new.