The parsing in this method is fine, but perhaps this would be more maintainable and easier to read if docker inspect had been used? It provides a json of data for an image or container.