diff --git a/buildrunner/docker/importer.py b/buildrunner/docker/importer.py index 074cfab..0f72774 100644 --- a/buildrunner/docker/importer.py +++ b/buildrunner/docker/importer.py @@ -6,11 +6,13 @@ with the terms of the Adobe license agreement accompanying it. """ +import python_on_whales import yaml import docker import docker.errors +from buildrunner.config import BuildRunnerConfig from buildrunner.docker import new_client from buildrunner.errors import BuildRunnerProcessingError from buildrunner.utils import is_dict @@ -41,7 +43,11 @@ def import_image(self): """ try: - import_return = self.docker_client.import_image(self.src) + import_return = None + if BuildRunnerConfig.get_instance().run_config.use_legacy_builder: + import_return = self.docker_client.import_image(self.src) + else: + import_return = python_on_whales.docker.import_(self.src) except docker.errors.APIError as apie: raise BuildRunnerProcessingError( f"Error importing image from archive file {self.src}: {apie}"