Start the indy_pool docker container iff it is not already running. See
    <indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures
    that the indy_pool container is up and running.

def startIndyPool(**kwargs):
    '''Start the indy_pool docker container iff it is not already running. See
    <indy-sdk>/ci/indy-pool.dockerfile for details. Idempotent. Simply ensures
    that the indy_pool container is up and running.'''

    # TODO: Decide if we need a separate docker container for testing and one for
    #       development. The indy_sdk tests setup and teardown "indy_pool" on
    #       ports 9701-9708. Perhaps we need an "indy_dev_pool" on 9709-9716? I'm
    #       not quite sure where all of our dependencies are on port 9701-9708.
    #       If the test harness (mocks) are hardcoding 9701-9708, then an
    #       indy_dev_pool on different ports will not work.

    print("Starting indy_pool ...")

    # Check if indy_pool is running
    if containerIsRunning("indy_pool"):
        print("... already running")
        exit(0)
    else:
        # If the container already exists and isn't running, force remove it and
        # readd it. This is brute force, but is sufficient and simple.
        container = getContainer("indy_pool")
        if container:
          container.remove(force=True)

    # Build and run indy_pool if it is not already running
    # Build the indy_pool image from the dockerfile in:
    #   /vagrant/indy-sdk/ci/indy-pool.dockerfile
    # 
    # In shell using docker cli:
    # cd /vagrant/indy-sdk
    # sudo docker build -f ci/indy-pool.dockerfile -t indy_pool .
    #
    # NOTE: https://jira.hyperledger.org/browse/IS-406 prevents indy_pool from
    #       starting on the `rc` branch. Apply the patch in the Jira issue to
    #       overcome this problem.

    try:
      # indy-sdk won't be in /vagrant if the indy-sdk is cloned to a directory outside
      # the Vagrant project. Regardless of where indy-sdk is cloned, it will be found
      # in /src/indy-sdk in the Vagrant VM.
      image = getImage(path="/src/indy-sdk", dockerfile="ci/indy-pool.dockerfile",
        tag="indy_pool")
    except TypeError as exc:
      image = getImage(path="/vagrant/indy-sdk", dockerfile="ci/indy-pool.dockerfile",
        tag="indy_pool")
    except:
      print("Failed to find indy-pool.dockerfile in /vagrant/indy-sdk or /src/indy-sdk")

    # Run a container using the image
    #
    # In shell using docker cli:
    # sudo docker run -itd -p 9701-9708:9701-9708 indy_pool
    #
    # NOTE: {'2222/tcp': 3333} is sufficient. A tuple of (address, port) if you
    #       want to specify the host interface. 
    container = runContainer(image, ports={
        '9701/tcp': ('0.0.0.0', 9701),
        '9702/tcp': ('0.0.0.0', 9702),
        '9703/tcp': ('0.0.0.0', 9703),
        '9704/tcp': ('0.0.0.0', 9704),
        '9705/tcp': ('0.0.0.0', 9705),
        '9706/tcp': ('0.0.0.0', 9706),
        '9707/tcp': ('0.0.0.0', 9707),
        '9708/tcp': ('0.0.0.0', 9708)
      }, detach=True, name="indy_pool"
    )

    print("...started")