(self, proot_mode="P2")
return True
Execute proot within runc
Execute proot within runc
Execute proot within runc
def _proot_overlay(self, proot_mode="P2"):
        """Execute proot within runc"""
        xmode = self.exec_mode.get_mode()
        if xmode not in ("R2", "R3"):
            return False

        preng = PRootEngine(self.localrepo, self.exec_mode)
        preng.exec_mode.force_mode = proot_mode
        preng.select_proot()
        if preng.proot_noseccomp or os.getenv("PROOT_NO_SECCOMP"):
            env_noseccomp = "PROOT_NO_SECCOMP=1"

        if xmode == "R2":
            env_noseccomp = ""

        if xmode == "R3":
            env_noseccomp = "PROOT_NO_SECCOMP=1"

        if env_noseccomp:
            self._container_specjson["process"]["env"].append(env_noseccomp)

        host_executable = preng.executable
        cont_executable = "/.udocker/bin/" + os.path.basename(host_executable)
        self._create_mountpoint(host_executable, cont_executable,
                                dirs_only=False)
        self._filebind.set_file(host_executable, cont_executable)
        self._filebind.add_file(host_executable, cont_executable)
        mode = stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR
        FileUtil(self._filebind.get_path(cont_executable)).chmod(mode)
        self._container_specjson["process"]["args"] = \
                [cont_executable, "-0"] + self.opt["cmd"]
        return True
def _proot_overlay ( self , proot_mode = "P2" ) : xmode = self . exec_mode . get_mode ( ) if xmode not in ( "R2" , "R3" ) : return False preng = PRootEngine ( self . localrepo , self . exec_mode ) preng . exec_mode . force_mode = proot_mode preng . select_proot ( ) if preng . proot_noseccomp or os . getenv ( "PROOT_NO_SECCOMP" ) : env_noseccomp = "PROOT_NO_SECCOMP=1" if xmode == "R2" : env_noseccomp = "" if xmode == "R3" : env_noseccomp = "PROOT_NO_SECCOMP=1" if env_noseccomp : self . _container_specjson [ "process" ] [ "env" ] . append ( env_noseccomp ) host_executable = preng . executable cont_executable = "/.udocker/bin/" + os . path . basename ( host_executable ) self . _create_mountpoint ( host_executable , cont_executable , dirs_only = False ) self . _filebind . set_file ( host_executable , cont_executable ) self . _filebind . add_file ( host_executable , cont_executable ) mode = stat . S_IRUSR | stat . S_IWUSR | stat . S_IXUSR FileUtil ( self . _filebind . get_path ( cont_executable ) ) . chmod ( mode ) self . _container_specjson [ "process" ] [ "args" ] = [ cont_executable , "-0" ] + self . opt [ "cmd" ] return True