more robust grep for the container's ports

still not optimal though