jupyter/julia/Dockerfile

21 lines
870 B
Docker
Raw Normal View History

FROM ben0i0d/jupyter:py-c AS builder
2024-03-17 15:40:43 +08:00
USER root
2024-04-12 16:10:40 +08:00
# install Julia packages in /opt/julias
RUN apt-get update --yes && apt-get install --yes --no-install-recommends gnupg && apt-get clean && rm -rf /var/lib/apt/lists/* && \
pip --no-cache-dir install jill && jill install --confirm
FROM ben0i0d/jupyter:py-c
COPY --chown="${NB_UID}:${NB_GID}" --from=builder /opt/julias/ /opt/julias/
ENV JULIA_PKG_SERVER=https://mirrors.ustc.edu.cn/julia \
JULIA_NUM_THREADS=12
# Install IJulia as jovyan and then move the kernelspec out to the system share location.
RUN sudo ln -s "`find /opt/julias -name 'bin'`/julia" /usr/local/bin/julia && \
julia -e 'import Pkg; Pkg.update()' && \
2024-03-17 15:40:43 +08:00
julia -e 'using Pkg; pkg"add IJulia"; pkg"precompile"' && \
2024-04-12 16:10:40 +08:00
mv "${HOME}/.local/share/jupyter/kernels/"* "/opt/base/share/jupyter/kernels/" && \
rm -rf "${HOME}/.local"