Can't use custom docker image for JupyterHub

I try to use a custom docker image for JupyterHub with Kubernetes on GKE, in which I want to use C++ and OCaml programming languages.

I started with this Dockerfile: Dockerfile without docker-stacks · GitHub
This works locally (with docker run) but not on JupyterHub :

2021-08-14T11:45:29Z [Warning] Error: failed to create containerd task: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: “jupyterhub-singleuser”: executable file not found in $PATH: unknown

Then I tried to use Jupyter docker-stacks images: Dockerfile with docker-stacks · GitHub
This works well locally and on Binder.
It starts on JupyterHub and I can use the C++ kernel but not the OCaml Kernel (it does not appear at all with jupyter kernelspec list).
I guess this is a permission problem (OCaml files should be installed in ~/.local and ~/.opam but are missing on JupyterHub) but I can’t figure how to solve it and I don’t understand very well why those fix-permissions calls are needed. I also don’t understand why it works on Binder and not on JupyterHub.

I also looked at the logs on GKE but didn’t see anything meaningful.

Moving the files out of the home directory did the trick. I find it somewhat confusing though. I could try to add documentation on this if needed.

@fortierq I am running into this too, could you elaborate a little more on what you did to fix this? What files did you move, and out of what home directory?

Sure! This is what I did : mp2i-jupyter-docker/Dockerfile at bc6fd4d2e6d1e493795daadae5340f8723cc9561 · fortierq/mp2i-jupyter-docker · GitHub
In the last line I copy files from home to CONDA_DIR:

rsync -a "${HOME}/.local/share/jupyter/kernels" "${CONDA_DIR}/share/jupyter"
1 Like