def _applications_from_containers(
            self, containers, path_to_manifestations
    ):
        applications = []
        for container in containers:
            image = DockerImage.from_string(container.container_image)
            volume = self._attached_volume_for_container(
                container, path_to_manifestations,
            )
            ports = self._ports_for_container(container)
            links, environment = self._environment_for_container(container)
            applications.append(Application(
                name=container.name,
                image=image,
                ports=frozenset(ports),
                volume=volume,
                environment=environment if environment else None,
                links=frozenset(links),
                memory_limit=container.mem_limit,
                cpu_shares=container.cpu_shares,
                restart_policy=container.restart_policy,
                running=(container.activation_state == u"active"),
                command_line=container.command_line,
            ))
        return applications
Reconstruct the original application state from the container state
dataset/ETHPy150Open ClusterHQ/flocker/flocker/node/_container.py/ApplicationNodeDeployer._applications_from_containers