Using xeus-cling kernel in jupyterhub running on kubernetes

I’m trying to set up a webpage that runs interactive C++ code. I have access to a kubernetes cluster with binderhub installed through helm. I would like xeus-cling to be enabled by default for all notebooks requested from the binderhub server. Is there a reasonable way of doing this?

I’ve been looking at the helm configuration of jupyterhub but don’t see anything suitable. It seems to be possible to install xeus-cling for a user by launching binderhub at the repostiory https://github.com/jupyter-xeus/xeus-cling. This seems like an inefficient solution to me, since the installation will be included in every user’s notebook, and will need to be reinstalled if there is a change to the repository.

BinderHub uses repo2docker to build container images that are then run by JupyterHub.

You can configure repo2docker to run a set of commands after every build:

However if your repositories rely on something in your appendix they won’t be compatible with any other BinderHub, so it would be better if you explicitly included xeus-cling in the dependencies for any repository that requires it.

Alternatively if your dependencies are fixed for all notebook repositories you can use nbgitpuller to decouple your dependencies from your notebook repositories, see