(self, container_id)
return status
Execute a Docker container using Fakechroot. This is the main
        method invoked to run the a container with Fakechroot.
          * argument: container_id or name
          * options:  many via self.opt see the help
Execute a Docker container using Fakechroot. This is the main
        method invoked to run the a container with Fakechroot.
          * argument: container_id or name
          * options:  many via self.opt see the help
Execute a Docker container using Fakechroot . This is the main method invoked to run the a container with Fakechroot . * argument : container_id or name * options : many via self . opt see the help
def run(self, container_id):
        """Execute a Docker container using Fakechroot. This is the main
        method invoked to run the a container with Fakechroot.
          * argument: container_id or name
          * options:  many via self.opt see the help
        """

        # warning root execution not supported
        self._uid_check()

        # setup execution
        exec_path = self._run_init(container_id)
        if not exec_path:
            return 2

        self._run_invalid_options()

        # execution mode and get patcher
        xmode = self.exec_mode.get_mode()
        self._elfpatcher = ElfPatcher(self.localrepo, self.container_id)

        # verify if container pathnames are correct for this mode
        if not self._elfpatcher.check_container_path():
            Msg().out("Warning: container path mismatch, use setup to convert",
                      l=Msg.WAR)

        # set basic environment variables
        self._run_env_set()
        self._fakechroot_env_set()

        # if not --hostenv clean the environment
        self._run_env_cleanup_list()

        # build the actual command
        cmd_l = self._set_cpu_affinity()
        cmd_l.extend(["env", "-i", ])
        cmd_l.extend(self.opt["env"].list())
        if xmode in ("F1", "F2"):
            container_loader = self._elfpatcher.get_container_loader()
            if container_loader:
                cmd_l.append(container_loader)
        cmd_l.extend(self._run_add_script_support(exec_path))
        cmd_l.extend(self.opt["cmd"])
        Msg().out("CMD =", cmd_l, l=Msg.VER)

        # execute
        self._run_banner(self.opt["cmd"][0], '#')
        cwd = FileUtil(self.container_root).cont2host(self.opt["cwd"],
                                                      self.opt["vol"])
        status = subprocess.call(cmd_l, shell=False, close_fds=True, cwd=cwd)
        return status
def run ( self , container_id ) : # warning root execution not supported self . _uid_check ( ) # setup execution exec_path = self . _run_init ( container_id ) if not exec_path : return 2 self . _run_invalid_options ( ) # execution mode and get patcher xmode = self . exec_mode . get_mode ( ) self . _elfpatcher = ElfPatcher ( self . localrepo , self . container_id ) # verify if container pathnames are correct for this mode if not self . _elfpatcher . check_container_path ( ) : Msg ( ) . out ( "Warning: container path mismatch, use setup to convert" , l = Msg . WAR ) # set basic environment variables self . _run_env_set ( ) self . _fakechroot_env_set ( ) # if not --hostenv clean the environment self . _run_env_cleanup_list ( ) # build the actual command cmd_l = self . _set_cpu_affinity ( ) cmd_l . extend ( [ "env" , "-i" , ] ) cmd_l . extend ( self . opt [ "env" ] . list ( ) ) if xmode in ( "F1" , "F2" ) : container_loader = self . _elfpatcher . get_container_loader ( ) if container_loader : cmd_l . append ( container_loader ) cmd_l . extend ( self . _run_add_script_support ( exec_path ) ) cmd_l . extend ( self . opt [ "cmd" ] ) Msg ( ) . out ( "CMD =" , cmd_l , l = Msg . VER ) # execute self . _run_banner ( self . opt [ "cmd" ] [ 0 ] , '#' ) cwd = FileUtil ( self . container_root ) . cont2host ( self . opt [ "cwd" ] , self . opt [ "vol" ] ) status = subprocess . call ( cmd_l , shell = False , close_fds = True , cwd = cwd ) return status