import pathlib


def parse_bind_volume(bind_arg):
    """unpack volume bind bind_arg (e.g., /foo:/bar) to dict where the key is a
    resolve pathlib.Path and the value is an unresolved (in-container)
    pathlib.PosixPath."""
    # can be up to three, but we only want the first two
    bind_arg = bind_arg.split(":")
    src, dst = bind_arg[:2]
    assert len(bind_arg) < 4, "unexpected number of bind_arg"
    return {pathlib.Path(src).resolve(): pathlib.PosixPath(dst)}