Repository navigation
Expand file tree
/
Copy pathDockerfile
More file actions
59 lines (46 loc) · 2.21 KB
/
Copy pathDockerfile
File metadata and controls
59 lines (46 loc) · 2.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
# Execute from root of repo as: docker buildx build --platform=linux/arm64,linux/amd64 -f docker/Dockerfile . --progress=plain
FROM ghcr.io/fenics/dolfinx/lab:nightly
ARG TARGETPLATFORM
ENV DEB_PYTHON_INSTALL_LAYOUT=deb_system
ENV HDF5_MPI="ON"
ENV OMPI_ALLOW_RUN_AS_ROOT=1
ENV OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1
ENV PRTE_MCA_rmaps_default_mapping_policy=:oversubscribe
WORKDIR /tmp/
# Requirements for pyvista (gl1 and render1) and jupyterlab (nodejs and curl)
RUN apt-get update && apt-get install -y libgl1-mesa-dev mesa-utils curl
# Install netgen from source
RUN apt-get update && \
apt-get -y install python3 python3-tk libpython3-dev libxmu-dev tk-dev tcl-dev cmake git g++ libglu1-mesa-dev liblapacke-dev libocct-data-exchange-dev libocct-draw-dev occt-misc libtbb-dev libxi-dev
WORKDIR /ngsuite
RUN git clone --branch=v6.2.2604 --single-branch https://github.com/NGSolve/netgen.git netgen-src
WORKDIR /ngsuite/netgen-src
RUN git submodule update --init --recursive
WORKDIR /ngsuite
RUN mkdir netgen-build
RUN mkdir netgen-install
RUN cmake -DCMAKE_CXX_FLAGS="-flax-vector-conversions" -DCMAKE_INSTALL_PREFIX=/ngsuite/netgen-install /ngsuite/netgen-src
RUN make
RUN make install
ENV NETGENDIR=/ngsuite/netgen-install/bin
ENV PATH=$NETGENDIR:$PATH
ENV PYTHONPATH=$NETGENDIR/../lib/python3.14/site-packages:${PYTHONPATH}:${PYTHONPATH}:$PATH
# Install vtk
RUN python3 -m pip install vtk
RUN ARCH_TRIPLET=$(gcc -print-multiarch) && \
export CC="mpicc" && \
export HDF5_MPI="ON" && \
export HDF5_INCLUDEDIR="/usr/include/hdf5/openmpi" && \
export HDF5_LIBDIR="/usr/lib/${ARCH_TRIPLET}/hdf5/openmpi" && \
pip install --no-binary=h5py h5py --no-build-isolation --no-cache-dir
ADD pyproject.toml /tmp/pyproject.toml
WORKDIR /tmp
# As we install netgen from source we don't need the netgen deps here
RUN python3 -m pip install --no-cache-dir --no-binary=h5py --no-build-isolation -v .
RUN python3 -m pip cache purge
RUN python3 -m pip install poetry_dynamic_versioning poetry-core
RUN python3 -m pip install ngsPETSc --no-build-isolation --no-deps
ENV PYVISTA_OFF_SCREEN="false"
ENV PYVISTA_JUPYTER_BACKEND="trame"
ENV LIBGL_ALWAYS_SOFTWARE=1
ENTRYPOINT ["jupyter", "lab", "--ip", "0.0.0.0", "--no-browser", "--allow-root"]