I am trying to get xeus-cling to work on a OCI image, currently I am using buildah + podman. I run into two problems
- I try to create an environment with mamba/conda, however it needs
conda/mamba init bashtoo run then to restart the shell. But its hard to get it to restart while its building, I have tried building multistage images,exit, running/bin/bash. I noticedcondachecks too see if certain files are configured in a certain way, including/home/joyvan/.bashrc, Icat'd out the modified.bashrcandCOPY'd it too the image -- no dice.activatetells me I need to runinit - I have tried installing it without the environment, I keep getting the error
Encountered problems while solving:
- nothing provides system needed by clangdev-5.0.0-default_0
I don't know which package specifically clangdev-5.0.0-default_0 is in (hence a bunch of commented out C++ relevant packages in the Dockerfile)
I have even got notebook to run a couple of times (cant remember what I did) but did not see the option to create a C++ notebook. I am wondering if this may be due to the fact that
I have put my Dockerfile in its current state below (I went a little crazy with Ctrl+Z)
Thank you for reading
- TFB :)
FROM docker.io/jupyter/scipy-notebook:latest
SHELL [ "/bin/bash", "-c" ]
RUN mamba install -y xeus -c conda-forge
RUN mamba install -y jupyterlab -c conda-forge
# RUN conda install gcc7 -c conda-forge
# RUN mamba install -y -c conda-forge clangdev
# RUN mamba install -y -c conda-forge/label/llvm_rc clangdev
# RUN mamba install -y -c conda-forge/label/cf202003 clangdev
# RUN mamba install -y -c conda-forge/label/gcc7 clangdev
# RUN mamba install -y -c conda-forge/label/broken clangdev
# RUN mamba install -y -c conda-forge/label/cf201901 clangdev
RUN mamba install -y -c conda-forge jupyter_contrib_nbextensions
# RUN conda init bash
# RUN conda create -n cling
# RUN conda activate cling
RUN mamba install -y xeus-cling -c conda-forge
Starting from the same image, a minimal working example of Jupyter with
xeus-clingkernel capabilities is:Dockerfile
Build and run
Then, from Jupyter I can create C++11, C++14, and C++17 kernels. Here is a C++14 one after running some trivial cells:
Additional Notes
These images have Jupyter installed in the base environment. If you want alternative kernels installed in other environments to get automatically picked up, we add
nb_conda_kernelsto the base.The
xeus-clingis then installed to a separate Conda environment.One should almost always chain Docker RUN commands, since this avoids unnecessarily generating intermediates.
If you want additional software available in an environment, say
boostin thexeus-cling, then include that in the creation - do not run multipleconda installcommands!. E.g.,The
mamba clean -qafyhelps minimize the size of the image.