Skip to content

Commit

Permalink
Simplify Dockerfile
Browse files Browse the repository at this point in the history
  • Loading branch information
jheinen committed Oct 18, 2024
1 parent ae999fb commit 673b0d7
Showing 1 changed file with 6 additions and 24 deletions.
30 changes: 6 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
FROM jupyter/base-notebook
FROM jupyter/base-notebook:aarch64-latest
USER root
# install Julia packages in /opt/julia instead of ${HOME}
ENV JULIA_DEPOT_PATH=/opt/julia
# Julia dependencies
RUN apt-get update && apt-get install -my wget curl gnupg && \
wget https://julialang-s3.julialang.org/bin/linux/x64/1.11/julia-1.11.0-linux-x86_64.tar.gz && \
tar -xzvf julia-1.11.0-linux-x86_64.tar.gz && ls && \
cp -R julia-1.11.0/* /usr && \
rm -rf ${HOME}/julia-1.11.0*
# Show Julia where conda libraries are
RUN echo "push!(Libdl.DL_LOAD_PATH, \"${CONDA_DIR}/lib\")" >> /usr/etc/julia/juliarc.jl && \
# Create JULIA_DEPOT_PATH
mkdir $JULIA_DEPOT_PATH && \
chown -R $NB_USER:users $JULIA_DEPOT_PATH
wget https://julialang-s3.julialang.org/bin/linux/aarch64/1.11/julia-1.11.1-linux-aarch64.tar.gz && \
tar -xzvf julia-1.11.1-linux-aarch64.tar.gz && ls && \
cp -R julia-1.11.1/* /usr && \
rm -rf ${HOME}/julia-1.11.1*
RUN apt-get install -my libnlopt0
# GR3 dependencies
RUN apt-get install -my xvfb
Expand All @@ -24,17 +17,6 @@ COPY examples/*.ipynb work/
COPY examples/snoop.jl work/
COPY scripts/docker-xvfb-run /usr/bin/xvfb-run
# Julia packages
RUN julia -E 'using Pkg; pkg"add GR IJulia PackageCompiler CSV HTTP JSON"' && \
# precompile Julia packages \
julia -e 'using GR' && \
julia -e 'using IJulia' && \
julia -e 'using PackageCompiler' && \
julia -e 'using CSV' && \
julia -e 'import HTTP' && \
julia -e 'import JSON' && \
# move kernelspec out of home \
mv ${HOME}/.local/share/jupyter/kernels/julia* ${CONDA_DIR}/share/jupyter/kernels/ && \
chmod -R go+rx ${CONDA_DIR}/share/jupyter && \
rm -rf ${HOME}/.local
RUN julia -E 'using Pkg; pkg"add GR IJulia PackageCompiler"'
ENTRYPOINT ["/bin/sh", "-c", "exec xvfb-run $0 $@"]
CMD ["jupyter", "notebook"]

0 comments on commit 673b0d7

Please sign in to comment.