diff --git a/Dockerfile b/Dockerfile index c3b39bff9d..ca9a7217f9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,48 +1,36 @@ -FROM python:3.10-slim +FROM ubuntu:22.04 # Set the working directory 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 python3.11-dev python3-pip +RUN apt-get install -y libopenblas-dev gcc gfortran graphviz git make g++ build-essential python3.9 python3-pip ENV CMAKE_C_COMPILER=/usr/bin/gcc ENV CMAKE_CXX_COMPILER=/usr/bin/g++ ENV CMAKE_MAKE_PROGRAM=/usr/bin/make +ENV SUNDIALS_INST=root/.local +ENV LD_LIBRARY_PATH=root/.local/lib: + +RUN python3.9 -m pip install wget # Copy project files into the container RUN git clone https://github.com/pybamm-team/PyBaMM.git WORKDIR /PyBaMM/ -# RUN python3.11 -m pip install virtualenv -RUN apt-get install -y python3.11-venv -RUN python3.11 -m venv venv -RUN /bin/bash -c "source venv/bin/activate" - -# Install PyBaMMs -RUN python3.11 -m pip install --upgrade pip setuptools wheel nox -# RUN pip install -e ".[all]" - -ARG ODES -ARG JAX -ARG IDAKLU +# Install virtualenv +RUN python3.9 -m pip install virtualenv +# Create and activate virtual environment +RUN virtualenv -p python3.9 venv +RUN /bin/bash -c "source venv/bin/activate" -# RUN if [ "$ODES" = "true" ]; then \ -# apt-get install -y cmake && \ -# pip install wget \ -# pybamm_install_odes; \ -# fi - -# RUN if [ "$JAX" = "true" ]; then \ -# pip install -e ".[jax,all]";\ -# fi - -RUN pip install wget cmake -RUN python scripts/install_KLU_Sundials.py +# Install PyBaMM +RUN python3.9 -m pip install --upgrade pip setuptools wheel nox +RUN python3.9 scripts/install_KLU_Sundials.py RUN git clone https://github.com/pybind/pybind11.git pybind11/ -RUN python3.11 -m pip install -e ".[all]" +RUN python3.9 -m pip install -e ".[all]" CMD ["/bin/bash"]