From 0f848f7855f5dfdd6b318a80d7d54aee9fa97614 Mon Sep 17 00:00:00 2001 From: Min RK Date: Thu, 18 Feb 2021 14:34:07 +0100 Subject: [PATCH] handle $R2D_ENTRYPOINT in new entrypoint --- repo2docker/buildpacks/repo2docker-entrypoint | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/repo2docker/buildpacks/repo2docker-entrypoint b/repo2docker/buildpacks/repo2docker-entrypoint index 90645c1e..1ff4dd61 100755 --- a/repo2docker/buildpacks/repo2docker-entrypoint +++ b/repo2docker/buildpacks/repo2docker-entrypoint @@ -1,5 +1,5 @@ #!/usr/bin/env python3 -# note: must run on Python >= 3.5 +# note: must run on Python >= 3.5, which mainly means no f-strings # goals: # - load environment variables from a login shell (bash -l) @@ -84,8 +84,13 @@ def main(): "a", ) + command = sys.argv[1:] + r2d_entrypoint = os.environ.get("R2D_ENTRYPOINT") + if r2d_entrypoint: + command.insert(0, r2d_entrypoint) + child = subprocess.Popen( - sys.argv[1:], + command, bufsize=1, env=env, start_new_session=True,