From 9cff64d3d2294085896de54f97dfa8bef9034159 Mon Sep 17 00:00:00 2001 From: ryanlovett Date: Wed, 17 May 2023 17:46:37 -0700 Subject: [PATCH] Add support for customizing r2d base_image. This is to address #111. --- hubploy/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hubploy/config.py b/hubploy/config.py index 5475c21..45d7075 100644 --- a/hubploy/config.py +++ b/hubploy/config.py @@ -26,7 +26,7 @@ class LocalImage: """ A docker image that can be built from a local filesystem source """ - def __init__(self, name, path, helm_substitution_path='jupyterhub.singleuser.image'): + def __init__(self, name, path, repo2docker={}, helm_substitution_path='jupyterhub.singleuser.image'): """ Create an Image from a local path @@ -44,6 +44,7 @@ def __init__(self, name, path, helm_substitution_path='jupyterhub.singleuser.ima self.tag = utils.last_modified_commit(path) self.path = path + self.repo2docker = repo2docker self.helm_substitution_path = helm_substitution_path self.image_spec = f'{self.name}:{self.tag}' @@ -54,6 +55,8 @@ def __init__(self, name, path, helm_substitution_path='jupyterhub.singleuser.ima self.r2d.user_id = 1000 self.r2d.user_name = 'jovyan' self.r2d.target_repo_dir = '/srv/repo' + if 'base_image' in self.repo2docker: + self.r2d.base_image = repo2docker.get('base_image') self.r2d.initialize() @property