Skip to content

Support passing of a config file to repo2docker during the build_docker #28

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions unity_app_generator/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def build_docker(args):
state_dir = check_state_directory(state_directory_path(args))

app_gen = UnityApplicationGenerator(state_dir,
repo2docker_config=args.config_file,
use_namespace=args.image_namespace,
use_repository=args.image_repository,
use_tag=args.image_tag)
Expand Down Expand Up @@ -138,6 +139,9 @@ def main():
parser_build_docker.add_argument("-t", "--image_tag",
help="Docker image tag to use instead of the automatically generated one from the Git commit id")

parser_build_docker.add_argument("-c", "--config_file",
help="JSON or Python Traitlets style config file for repo2docker. Use 'repo2docker --help-all' to see configurable options.")

parser_build_docker.set_defaults(func=build_docker)

# push_docker
Expand Down
5 changes: 3 additions & 2 deletions unity_app_generator/generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class ApplicationGenerationError(Exception):

class UnityApplicationGenerator(object):

def __init__(self, state_directory, source_repository=None, destination_directory=None, checkout=None,
use_namespace=None, use_repository=None, use_tag=None):
def __init__(self, state_directory, source_repository=None, destination_directory=None, checkout=None,
repo2docker_config=None, use_namespace=None, use_repository=None, use_tag=None):

if not ApplicationState.exists(state_directory):
self.repo_info = self._localize_source(source_repository, destination_directory, checkout)
Expand All @@ -35,6 +35,7 @@ def __init__(self, state_directory, source_repository=None, destination_director
image_tag = use_tag if use_tag is not None else self.app_state.docker_image_tag

self.docker_util = DockerUtil(self.repo_info, do_prune=False,
repo_config=repo2docker_config,
use_namespace=image_namespace,
use_repository=image_repository,
use_tag=image_tag)
Expand Down