invoke start script from our entrypoint
rather than replacing our entrypoint
MODIFY
repo2docker/buildpacks/base.py
repo2docker/buildpacks/base.py
@@ -154,12 +154,12 @@ RUN ./{{ s }}
# Add start script
{% if start_script is not none -%}
-RUN chmod +x "{{ start_script }}"
-ENTRYPOINT ["{{ start_script }}"]
-{% else %}
+ENV R2D_ENTRYPOINT "{{ start_script }}"
+{% endif -%}
+
+# Add entrypoint
COPY /repo2docker-entrypoint /usr/local/bin/repo2docker-entrypoint
ENTRYPOINT ["/usr/local/bin/repo2docker-entrypoint"]
-{% endif -%}
# Specify the default command to run
CMD ["jupyter", "notebook", "--ip", "0.0.0.0"]

MODIFY
repo2docker/buildpacks/repo2docker-entrypoint
repo2docker/buildpacks/repo2docker-entrypoint
# lightest possible entrypoint that ensures that
# we use a login shell to get a fully configured shell environment
# (e.g. sourcing /etc/profile.d, ~/.bashrc, and friends)
+if [[ ! -z "${R2D_ENTRYPOINT:-}" ]]; then
+ exec "$R2D_ENTRYPOINT" "$@"
+else
exec "$@"
+fi

invoke start script from our entrypoint

rather than replacing our entrypoint