<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _os_install(self, package_file):
 """ take in a dict return a string of docker build RUN directives one RUN per package type one package type per JSON key """

        packages = " ".join(json.load(package_file.open()))
        if packages:
            for packager in self.pkg_install_cmds:
                if packager in self.context.externalbasis:
                    installer = self.pkg_install_cmds[packager]
            return f"RUN    {installer} {packages}"
        else:
            return ""