Example #1
0
    def resolve_deps(self):
        '''Uses the dockerize.DepSolver class to find all the shared
        library dependencies of files installed into the Docker image.'''

        deps = DepSolver()

        # Iterate over all files in the image.
        for root, dirs, files in os.walk(self.targetdir):
            for name in files:
                path = os.path.join(root, name)
                deps.add(path)

        for src in deps.deps:
            self.copy_file(src, symlinks=symlink_options.COPY_ALL)

        # Install some basic nss libraries to permit programs to resolve
        # users, groups, and hosts.
        for libdir in deps.prefixes():
            for nsslib in ['libnss_dns.so.2',
                           'libnss_files.so.2',
                           'libnss_compat.so.2']:
                src = os.path.join(libdir, nsslib)
                LOG.info('looking for %s', src)
                if os.path.exists(src):
                    self.copy_file(src, symlinks=symlink_options.COPY_ALL)
Example #2
0
    def resolve_deps(self):
        '''Uses the dockerize.DepSolver class to find all the shared
        library dependencies of files installed into the Docker image.'''

        deps = DepSolver()

        # Iterate over all files in the image.
        for root, dirs, files in os.walk(self.targetdir):
            for name in files:
                path = os.path.join(root, name)
                deps.add(path)

        for src in deps.deps:
            self.copy_file(src, symlinks=symlink_options.COPY_ALL)

        # Install some basic nss libraries to permit programs to resolve
        # users, groups, and hosts.
        for libdir in deps.prefixes():
            for nsslib in [
                    'libnss_dns.so.2', 'libnss_files.so.2',
                    'libnss_compat.so.2'
            ]:
                src = os.path.join(libdir, nsslib)
                LOG.info('looking for %s', src)
                if os.path.exists(src):
                    self.copy_file(src, symlinks=symlink_options.COPY_ALL)