def _transform_volumes(volumes):
    """Transform volume mapping from list to dict regconized by docker lib
    """
    dict_volume = {}
    for volume in volumes:
        # Example format:
        #   /var/tmp:/dest_var_tmp:rw => {
        #       /var/tmp': {
        #           'bind': '/dest_var_tmp',
        #           'mode': 'rw
        #       }
        #   }
        (target, source, mode) = volume.split(':', 2)
        dict_volume[target] = {'bind': source, 'mode': mode}

    return dict_volume