# Buggy code
def resolve(
    self, enabled_container_types, tool_info, install=False, session=None, **kwds
):
    resolution_cache = kwds.get("resolution_cache")
    if (
        tool_info.requires_galaxy_python_environment
        or self.container_type not in enabled_container_types
    ):
        return None

    targets = mulled_targets(tool_info)
    if len(targets) == 0:
        return None

    name = targets_to_mulled_name(
        targets=targets,
        hash_func=self.hash_func,
        namespace=self.namespace,
        resolution_cache=resolution_cache,
        session=session,
    )
    if name:
        container_id = "quay.io/{}/{}".format(self.namespace, name)
        if self.protocol:
            container_id = "{}{}".format(self.protocol, container_id)
        container_description = ContainerDescription(
            container_id,
            type=self.container_type,
            shell=self.shell,
        )
        if install and not self.cached_container_description(
            targets,
            namespace=self.namespace,
            hash_func=self.hash_func,
            resolution_cache=resolution_cache,
        ):
            destination_info = {}
            destination_for_container_type = kwds.get("destination_for_container_type")
            if destination_for_container_type:
                destination_info = destination_for_container_type(self.container_type)
            container = CONTAINER_CLASSES[self.container_type](
                container_description.identifier,
                self.app_info,
                tool_info,
                destination_info,
                {},
                container_description,
            )
            self.pull(container)
        if not self.auto_install:
            container_description = self.cached_container_description(
                targets,
                namespace=self.namespace,
                hash_func=self.hash_func,
                resolution_cache=resolution_cache,
            )
        return container_description


# Traceback (FileNotFoundError)
urllib3.connectionpool DEBUG 2021-01-13 15:26:00,421 https://quay.io:443 "GET /api/v1/repository/biocontainers/porechop HTTP/1.1" 200 4033
galaxy.tool_util.deps.containers ERROR 2021-01-13 15:26:00,499 Could not get container description for tool 'toolshed.g2.bx.psu.edu/repos/iuc/porechop/porechop/0.2.3'
Traceback (most recent call last):
File "/galaxy/server/lib/galaxy/tool_util/deps/containers.py", line 243, in find_best_container_description
resolved_container_description = self.resolve(enabled_container_types, tool_info, **kwds)
File "/galaxy/server/lib/galaxy/tool_util/deps/containers.py", line 265, in resolve
container_description = container_resolver.resolve(enabled_container_types, tool_info, install=install, resolution_cache=resolution_cache, session=session)
File "/galaxy/server/lib/galaxy/tool_util/deps/container_resolvers/mulled.py", line 410, in resolve
if install and not self.cached_container_description(
File "/galaxy/server/lib/galaxy/tool_util/deps/container_resolvers/mulled.py", line 385, in cached_container_description
return docker_cached_container_description(targets, namespace, hash_func, resolution_cache)
File "/galaxy/server/lib/galaxy/tool_util/deps/container_resolvers/mulled.py", line 202, in docker_cached_container_description
cached_images = list_docker_cached_mulled_images(namespace, hash_func=hash_func, resolution_cache=resolution_cache)
File "/galaxy/server/lib/galaxy/tool_util/deps/container_resolvers/mulled.py", line 71, in list_docker_cached_mulled_images
images_and_versions = unicodify(subprocess.check_output(command)).strip().splitlines()
File "/usr/lib/python3.8/subprocess.py", line 411, in check_output
return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.8/subprocess.py", line 489, in run
with Popen(*popenargs, **kwargs) as process:
File "/usr/lib/python3.8/subprocess.py", line 854, in __init__
self._execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.8/subprocess.py", line 1702, in _execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'docker'

# Fixed code
def resolve(
    self, enabled_container_types, tool_info, install=False, session=None, **kwds
):
    resolution_cache = kwds.get("resolution_cache")
    if (
        tool_info.requires_galaxy_python_environment
        or self.container_type not in enabled_container_types
    ):
        return None

    targets = mulled_targets(tool_info)
    if len(targets) == 0:
        return None

    name = targets_to_mulled_name(
        targets=targets,
        hash_func=self.hash_func,
        namespace=self.namespace,
        resolution_cache=resolution_cache,
        session=session,
    )
    if name:
        container_id = "quay.io/{}/{}".format(self.namespace, name)
        if self.protocol:
            container_id = "{}{}".format(self.protocol, container_id)
        container_description = ContainerDescription(
            container_id,
            type=self.container_type,
            shell=self.shell,
        )
        if self.docker_cli_available:
            if install and not self.cached_container_description(
                targets,
                namespace=self.namespace,
                hash_func=self.hash_func,
                resolution_cache=resolution_cache,
            ):
                destination_info = {}
                destination_for_container_type = kwds.get(
                    "destination_for_container_type"
                )
                if destination_for_container_type:
                    destination_info = destination_for_container_type(
                        self.container_type
                    )
                container = CONTAINER_CLASSES[self.container_type](
                    container_description.identifier,
                    self.app_info,
                    tool_info,
                    destination_info,
                    {},
                    container_description,
                )
                self.pull(container)
            if not self.auto_install:
                container_description = self.cached_container_description(
                    targets,
                    namespace=self.namespace,
                    hash_func=self.hash_func,
                    resolution_cache=resolution_cache,
                )
        return container_description