diff --git a/scripts/Dockerfile b/scripts/Dockerfile index 3cfbeaa11c..afa287fa48 100644 --- a/scripts/Dockerfile +++ b/scripts/Dockerfile @@ -4,7 +4,7 @@ WORKDIR / # Install the necessary dependencies RUN apt-get update && apt-get -y upgrade -RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake +RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential cmake pandoc texlive-latex-extra dvipng RUN rm -rf /var/lib/apt/lists/* RUN useradd -m -s /bin/bash pybamm @@ -21,45 +21,50 @@ ENV CMAKE_C_COMPILER=/usr/bin/gcc ENV CMAKE_CXX_COMPILER=/usr/bin/g++ ENV CMAKE_MAKE_PROGRAM=/usr/bin/make ENV SUNDIALS_INST=/home/pybamm/.local -ENV LD_LIBRARY_PATH=/home/pybamm/.local/lib: +ENV LD_LIBRARY_PATH=/home/pybamm/.local/lib + +RUN conda create -n pybamm python=3.11 +RUN conda init --all +SHELL ["conda", "run", "-n", "pybamm", "/bin/bash", "-c"] +RUN conda install -y pip ARG IDAKLU ARG ODES ARG JAX ARG ALL -RUN conda create -n pybamm python=3.9 -RUN conda init --all -SHELL ["conda", "run", "-n", "pybamm", "/bin/bash", "-c"] -RUN conda install -y pip - RUN if [ "$IDAKLU" = "true" ]; then \ - pip install --upgrade --user pip setuptools wheel wget && \ - pip install cmake==3.22 && \ + pip install --upgrade --user pip setuptools wheel wget nox && \ + pip install cmake && \ python scripts/install_KLU_Sundials.py && \ git clone https://github.com/pybind/pybind11.git && \ - pip install --user -e ".[all,dev]"; \ + pip install --user -e ".[all,dev,docs]"; \ fi RUN if [ "$ODES" = "true" ]; then \ - pip install cmake==3.22 && \ - pip install --upgrade --user pip wget && \ + pip install --upgrade --user pip setuptools wheel wget nox && \ + pip install cmake && \ python scripts/install_KLU_Sundials.py && \ - pip install --user -e ".[all,odes,dev]"; \ + git clone https://github.com/pybind/pybind11.git && \ + pip install --user -e ".[all,dev,docs,odes]"; \ fi RUN if [ "$JAX" = "true" ]; then \ - pip install --user -e ".[jax,all,dev]";\ + pip install --upgrade --user pip setuptools wheel wget nox && \ + pip install cmake && \ + python scripts/install_KLU_Sundials.py && \ + git clone https://github.com/pybind/pybind11.git && \ + pip install --user -e ".[all,dev,docs,jax]"; \ fi RUN if [ "$ALL" = "true" ]; then \ - pip install cmake==3.22 && \ - pip install --upgrade --user pip setuptools wheel wget && \ + pip install --upgrade --user pip setuptools wheel wget nox && \ + pip install cmake && \ python scripts/install_KLU_Sundials.py && \ git clone https://github.com/pybind/pybind11.git && \ - pip install --user -e ".[all,dev,jax,odes]"; \ + pip install --user -e ".[all,dev,docs,jax,odes]"; \ fi -RUN pip install --user -e ".[all,dev]" +RUN pip install --user -e ".[all,dev,docs]" ENTRYPOINT ["/bin/bash"]