mirror of
https://github.com/jupyter/docker-stacks.git
synced 2025-10-17 23:12:56 +00:00
Fix hadolint deviations
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
# Copyright (c) Jupyter Development Team.
|
||||
# Distributed under the terms of the Modified BSD License.
|
||||
ARG BASE_CONTAINER=jupyter/scipy-notebook
|
||||
# hadolint ignore=DL3006
|
||||
FROM $BASE_CONTAINER
|
||||
|
||||
LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
|
||||
@@ -9,9 +10,13 @@ LABEL maintainer="Jupyter Project <jupyter@googlegroups.com>"
|
||||
# be skipped to shorten build time.
|
||||
ARG TEST_ONLY_BUILD
|
||||
|
||||
# Fix DL4006
|
||||
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
|
||||
|
||||
USER root
|
||||
|
||||
# R pre-requisites
|
||||
# hadolint ignore=DL3008
|
||||
RUN apt-get update && \
|
||||
apt-get install -y --no-install-recommends \
|
||||
fonts-dejavu \
|
||||
@@ -25,21 +30,24 @@ ENV JULIA_DEPOT_PATH=/opt/julia
|
||||
ENV JULIA_PKGDIR=/opt/julia
|
||||
ENV JULIA_VERSION=1.4.1
|
||||
|
||||
RUN mkdir /opt/julia-${JULIA_VERSION} && \
|
||||
cd /tmp && \
|
||||
wget -q https://julialang-s3.julialang.org/bin/linux/x64/`echo ${JULIA_VERSION} | cut -d. -f 1,2`/julia-${JULIA_VERSION}-linux-x86_64.tar.gz && \
|
||||
WORKDIR /tmp
|
||||
|
||||
# TODO
|
||||
# hadolint ignore=SC2046
|
||||
RUN mkdir "/opt/julia-${JULIA_VERSION}" && \
|
||||
wget -q https://julialang-s3.julialang.org/bin/linux/x64/$(echo "${JULIA_VERSION}" | cut -d. -f 1,2)"/julia-${JULIA_VERSION}-linux-x86_64.tar.gz" && \
|
||||
echo "fd6d8cadaed678174c3caefb92207a3b0e8da9f926af6703fb4d1e4e4f50610a *julia-${JULIA_VERSION}-linux-x86_64.tar.gz" | sha256sum -c - && \
|
||||
tar xzf julia-${JULIA_VERSION}-linux-x86_64.tar.gz -C /opt/julia-${JULIA_VERSION} --strip-components=1 && \
|
||||
rm /tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz
|
||||
tar xzf "julia-${JULIA_VERSION}-linux-x86_64.tar.gz" -C "/opt/julia-${JULIA_VERSION}" --strip-components=1 && \
|
||||
rm "/tmp/julia-${JULIA_VERSION}-linux-x86_64.tar.gz"
|
||||
RUN ln -fs /opt/julia-*/bin/julia /usr/local/bin/julia
|
||||
|
||||
# Show Julia where conda libraries are \
|
||||
RUN mkdir /etc/julia && \
|
||||
echo "push!(Libdl.DL_LOAD_PATH, \"$CONDA_DIR/lib\")" >> /etc/julia/juliarc.jl && \
|
||||
# Create JULIA_PKGDIR \
|
||||
mkdir $JULIA_PKGDIR && \
|
||||
chown $NB_USER $JULIA_PKGDIR && \
|
||||
fix-permissions $JULIA_PKGDIR
|
||||
mkdir "${JULIA_PKGDIR}" && \
|
||||
chown "${NB_USER}" "${JULIA_PKGDIR}" && \
|
||||
fix-permissions "${JULIA_PKGDIR}"
|
||||
|
||||
USER $NB_UID
|
||||
|
||||
@@ -66,8 +74,8 @@ RUN conda install --quiet --yes \
|
||||
'rpy2=3.1*' \
|
||||
&& \
|
||||
conda clean --all -f -y && \
|
||||
fix-permissions $CONDA_DIR && \
|
||||
fix-permissions /home/$NB_USER
|
||||
fix-permissions "${CONDA_DIR}" && \
|
||||
fix-permissions "/home/${NB_USER}"
|
||||
|
||||
# Add Julia packages. Only add HDF5 if this is not a test-only build since
|
||||
# it takes roughly half the entire build time of all of the images on Travis
|
||||
@@ -77,10 +85,12 @@ RUN conda install --quiet --yes \
|
||||
# to the system share location. Avoids problems with runtime UID change not
|
||||
# taking effect properly on the .local folder in the jovyan home dir.
|
||||
RUN julia -e 'import Pkg; Pkg.update()' && \
|
||||
(test $TEST_ONLY_BUILD || julia -e 'import Pkg; Pkg.add("HDF5")') && \
|
||||
(test "${TEST_ONLY_BUILD}" || julia -e 'import Pkg; Pkg.add("HDF5")') && \
|
||||
julia -e "using Pkg; pkg\"add IJulia\"; pkg\"precompile\"" && \
|
||||
# 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 && \
|
||||
fix-permissions $JULIA_PKGDIR $CONDA_DIR/share/jupyter
|
||||
mv "${HOME}/.local/share/jupyter/kernels/julia*" "${CONDA_DIR}/share/jupyter/kernels/" && \
|
||||
chmod -R go+rx "${CONDA_DIR}/share/jupyter" && \
|
||||
rm -rf "${HOME}/.local" && \
|
||||
fix-permissions "${JULIA_PKGDIR}" "${CONDA_DIR}/share/jupyter"
|
||||
|
||||
WORKDIR $HOME
|
Reference in New Issue
Block a user