Skip to content

Commit

Permalink
Using ubuntu:22.04 as base image
Browse files Browse the repository at this point in the history
  • Loading branch information
arjxn-py committed Aug 12, 2023
1 parent 9991cbc commit aa2522f
Showing 1 changed file with 15 additions and 27 deletions.
42 changes: 15 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit aa2522f

Please sign in to comment.