-
Notifications
You must be signed in to change notification settings - Fork 118
Expand file tree
/
Copy pathDockerfile.noble
More file actions
73 lines (61 loc) · 3.51 KB
/
Dockerfile.noble
File metadata and controls
73 lines (61 loc) · 3.51 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
# DockerFile for a Fludity development container
# Use an Noble base image
FROM ubuntu:noble
# This DockerFile is looked after by
MAINTAINER Stephan Kramer <s.kramer@imperial.ac.uk>
# Installs shouldn't expect input
ENV DEBIAN_FRONTEND=noninteractive
# Package updates and installs
RUN apt-get update && \
apt-get -y dist-upgrade && \
apt-get -y install gnupg dirmngr && \
echo "deb http://ppa.launchpad.net/fluidity-core/ppa/ubuntu noble main" > /etc/apt/sources.list.d/fluidity-core-ppa-noble.list && \
gpg --keyserver keyserver.ubuntu.com --recv 0D45605A33BAC3BE && \
gpg --export --armor 33BAC3BE | apt-key add - && \
apt-get update && \
echo "Europe/London" > /etc/timezone && \
apt-get -y install fluidity-dev texlive-pstricks texlive texlive-latex-extra texlive-science python3-pip python3-junit.xml && \
apt-get -y install sudo flex bison && \
apt-get -y install gmsh && \
apt-get clean
# Use old version of gmsh in CI to avoid mesh-sensitive tests failing
# WORKDIR /usr/local
# RUN curl -fsL https://gmsh.info/bin/Linux/gmsh-2.16.0-Linux64.tgz | tar --strip-components=1 -zxf -
RUN gmsh --version
ENV OMPI_MCA_btl_vader_single_copy_mechanism=none
ENV OMPI_MCA_rmaps_base_oversubscribe=1
# Build vtk 9.4 instead of noble's vtk 9.2 as we need the fix for https://gitlab.kitware.com/vtk/vtk/-/issues/19258
# (failing reading of vtk files with newer versions of expat)
WORKDIR /root
RUN curl -fsL https://vtk.org/files/release/9.4/VTK-9.4.0.tar.gz | tar -xzf - && \
cd VTK-9.4.0 && \
mkdir build && \
cd build && \
cmake -DCMAKE_INSTALL_PREFIX=/opt/vtk-9.4.0 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVTK_SMP_IMPLEMENTATION_TYPE:STRING=TBB -DBUILD_SHARED_LIBS=ON -DCMAKE_C_COMPILER=mpicc -DCMAKE_CXX_COMPILER=mpic\+\+ -DCMAKE_EXE_LINKER_FLAGS='-Wl,--as-needed -latomic' -DCMAKE_MODULE_LINKER_FLAGS=-Wl,--as-needed -DCMAKE_SHARED_LINKER_FLAGS=-Wl,--as-needed -DHDF5_IS_PARALLEL=OFF -DVTK_WRAP_PYTHON=ON -DVTK_USE_TK=ON -DVTK_USE_MPI=ON .. && \
cmake --build . -j 12 && \
cmake --install . && \
cd ../.. && \
rm -rf VTK-9.4.0
# Build petsc 3.24 because noble's petsc version has an intermediate gamg with known issues
WORKDIR /tmp
RUN curl -O https://web.cels.anl.gov/projects/petsc/download/release-snapshots/petsc-3.24.2.tar.gz
RUN tar -xzf petsc-3.24.2.tar.gz && mv petsc-3.24.2 /opt/petsc && rm petsc-3.24.2.tar.gz
WORKDIR /opt/petsc
RUN ./configure --with-debugging=1 --with-fortran-bindings=1 --with-shared-libraries=1 --with-strict-petscerrorcode --with-bison --with-fftw --with-hdf5 --with-hwloc --with-metis --with-mumps --download-netcdf --download-pnetcdf --download-ptscotch --with-scalapack-lib=-lscalapack-openmpi --with-suitesparse --download-superlu_dist --with-zlib --download-hypre -download-hdf5
RUN make PETSC_DIR=/opt/petsc PETSC_ARCH=arch-linux-c-debug all
# Environment for building fluidity with this vtk and petsc
ENV VTK_INSTALL_PREFIX=/opt/vtk-9.4.0
ENV PETSC_DIR=/opt/petsc
ENV PETSC_ARCH=arch-linux-c-debug
ENV PATH="$PETSC_DIR/$PETSC_ARCH/bin:$PATH"
ENV PYTHONPATH="/opt/vtk-9.4.0/lib/python3.12/site-packages"
# Add a Fluidity user who will be the default user for this container
# Make sure the user has a userid matching the host system
# -- pass this as an argument at build time
ARG userid=1000
# if this uid already exists (starting from ubuntu base image this can
# only be user `ubuntu` with uid=1000) remove it
RUN getent passwd $userid && deluser ubuntu
RUN adduser --disabled-password --gecos "" -u $userid fluidity
USER fluidity
WORKDIR /home/fluidity