Skip to content

Commit

Permalink
Install julia via conda
Browse files Browse the repository at this point in the history
  • Loading branch information
tmetzl committed Aug 29, 2024
1 parent 0459174 commit fa578cd
Showing 1 changed file with 11 additions and 33 deletions.
44 changes: 11 additions & 33 deletions images/julia-notebook/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,38 +4,16 @@ FROM $IMAGE_SOURCE
LABEL maintainer="e2x project H-BRS <e2x@inf.h-brs.de>"
LABEL description="e2x julia notebook"

USER root

# Install Julia
ARG JULIA_VERSION=1.10.5

RUN apt-get update -y \
&& apt-get install --yes \
wget \
tar \
&& wget -q https://julialang-s3.julialang.org/bin/linux/x64/"$(echo $JULIA_VERSION | cut -d. -f1-2)"/julia-"$JULIA_VERSION"-linux-x86_64.tar.gz \
&& tar -xzf julia-"$JULIA_VERSION"-linux-x86_64.tar.gz \
&& mv julia-"$JULIA_VERSION" /opt/ \
&& ln -s /opt/julia-"$JULIA_VERSION"/bin/julia /usr/local/bin/julia \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
&& rm julia-"$JULIA_VERSION"-linux-x86_64.tar.gz

# Create a shared environment directory for Julia packages
RUN mkdir -p /opt/julia-env \
&& chown root:staff /opt/julia-env \
&& chmod 775 /opt/julia-env

# Set JULIA_DEPOT_PATH to the shared environment directory
ENV JULIA_DEPOT_PATH="/opt/julia-env"

# Install the IJulia kernel globally
RUN julia -e 'using Pkg; Pkg.add("IJulia"); using IJulia'

# Set permissions for the shared environment directory
RUN chmod -R 777 /opt/julia-env

USER $NB_USER

# Verify IJulia installation for all users
RUN julia -e 'using IJulia; println("IJulia installation verified")'
# Install Julia and IJulia package
RUN mamba install -y -c conda-forge julia \
&& /opt/conda/bin/julia -e 'using Pkg; Pkg.add("IJulia");' \

# Move IJulia kernel to the appropriate location
&& mkdir -p /opt/conda/share/jupyter/kernels/ \
&& mv /home/"$NB_USER"/.local/share/jupyter/kernels/* /opt/conda/share/jupyter/kernels/ \

# Verify the installation and list the available kernels
&& /opt/conda/bin/julia -e 'using IJulia;' \
&& jupyter kernelspec list

0 comments on commit fa578cd

Please sign in to comment.