Skip to content

Commit

Permalink
Add support for customizing r2d base_image.
Browse files Browse the repository at this point in the history
This is to address #111.
  • Loading branch information
ryanlovett committed May 18, 2023
1 parent dfc0025 commit 9cff64d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion hubploy/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}'

Expand All @@ -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
Expand Down

0 comments on commit 9cff64d

Please sign in to comment.