Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions scripts/docker_files/docker_file_ci_ubuntu_20_04/DockerFile
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ RUN apt-get update -y && apt-get upgrade -y && \
apt-get -y autoremove && \
apt-get clean

# Install Boost (form zip)
RUN wget -P /workspace/boost https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz &&\
tar -C /workspace/boost -xzf /workspace/boost/boost_1_87_0.tar.gz && \
rm /workspace/boost/boost_1_87_0.tar.gz

CMD [ "/bin/bash" ]

WORKDIR $HOME
131 changes: 72 additions & 59 deletions scripts/docker_files/docker_file_ci_ubuntu_22_04/DockerFile
Original file line number Diff line number Diff line change
@@ -1,79 +1,92 @@
FROM ubuntu:jammy

ENV HOME /root
ENV HOME=/root

RUN apt-get update -y && apt-get upgrade -y && \
apt-get -y install --no-install-recommends \
gnupg2 \
software-properties-common \
wget && \
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB -P/tmp && \
# Update and install necessary packages
RUN apt-get update -y && apt-get upgrade -y
RUN apt-get -y install --no-install-recommends gnupg2 software-properties-common wget

# Adding intel ppa and installing packages
RUN wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB -P/tmp && \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you use multipe RUN sections? This can considerably increase the size of the image!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

because we share the same layers for multiple containers internally, it is true that individually they weight more, but globally the reduction is considerable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate what you mean by internally? Multistage builds?

Copy link
Member Author

@roigcarlo roigcarlo Jul 8, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No multistage, I have several flavours of images, for example the most typical usage is to change the MMG/Python/boost versions (I have builds with different permutations of those lib versions). By splitting those into layers I save a lot of space because the base is common for all of them.

apt-key add /tmp/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
rm /tmp/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB && \
echo deb https://apt.repos.intel.com/oneapi all main > /etc/apt/sources.list.d/oneAPI.list && \
add-apt-repository ppa:git-core/ppa && \
apt-get -y update && \
apt-get install -y --no-install-recommends \
sudo \
build-essential \
g++-12 \
gfortran-12 \
clang-14 \
libomp-dev \
cmake \
gfortran \
git \
intel-oneapi-compiler-dpcpp-cpp \
intel-oneapi-mkl-devel \
libboost-dev \
libhdf5-dev \
libhdf5-openmpi-dev \
libmetis-dev \
libopenmpi-dev \
libscotch-dev \
libtrilinos-amesos-dev \
libtrilinos-amesos2-dev \
libtrilinos-aztecoo-dev \
libtrilinos-epetra-dev \
libtrilinos-epetraext-dev \
libtrilinos-ifpack-dev \
libtrilinos-ml-dev \
libtrilinos-teuchos-dev \
libtrilinos-tpetra-dev \
libtrilinos-kokkos-dev \
libtrilinos-kokkos-kernels-dev \
libtrilinos-shylu-dev \
libmedc-dev \
openmpi-bin \
python3-dev \
python3-h5py \
python3-pip && \
python3 -m pip install --upgrade pip && \
pip3 install \
numpy \
scipy \
sympy \
parameterized && \
# install MMG 5.5
git clone -b 'v5.5.1' --depth 1 https://github.com/MmgTools/mmg /tmp/mmg_5_5_1 && \
echo deb https://apt.repos.intel.com/oneapi all main > /etc/apt/sources.list.d/oneAPI.list

# Update again with the new ppa
RUN add-apt-repository ppa:git-core/ppa && \
apt-get -y update

# Install packages
RUN apt-get install -y --no-install-recommends \
sudo \
build-essential \
g++-12 \
gfortran-12 \
clang-14 \
libomp-dev \
cmake \
gfortran \
git \
intel-oneapi-compiler-dpcpp-cpp \
intel-oneapi-mkl-devel \
libboost-dev \
libhdf5-dev \
libhdf5-openmpi-dev \
libmetis-dev \
libopenmpi-dev \
libscotch-dev \
libtrilinos-amesos-dev \
libtrilinos-amesos2-dev \
libtrilinos-aztecoo-dev \
libtrilinos-epetra-dev \
libtrilinos-epetraext-dev \
libtrilinos-ifpack-dev \
libtrilinos-ml-dev \
libtrilinos-teuchos-dev \
libtrilinos-tpetra-dev \
libtrilinos-kokkos-dev \
libtrilinos-kokkos-kernels-dev \
libtrilinos-shylu-dev \
libmedc-dev \
openmpi-bin \
python3-dev \
python3-h5py \
python3-pip

# Upgrade Pip
RUN python3 -m pip install --upgrade pip

# Install Python packages
RUN pip3 install numpy scipy sympy parameterized

# install MMG 5.5
RUN git clone -b 'v5.5.1' --depth 1 https://github.com/MmgTools/mmg /tmp/mmg_5_5_1 && \
mkdir /tmp/mmg_5_5_1/build && \
mkdir -p /external_libraries/mmg/mmg_5_5_1 && \
cd /tmp/mmg_5_5_1/build && \
cmake .. -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DCMAKE_INSTALL_PREFIX="/external_libraries/mmg/mmg_5_5_1" -DUSE_SCOTCH=OFF -DLIBMMG3D_SHARED=ON -DLIBMMG2D_SHARED=ON -DLIBMMGS_SHARED=ON -DLIBMMG_SHARED=ON && \
make -j2 install && \
cd / && \
# install PARMMG
git clone https://github.com/MmgTools/ParMmg /tmp/ParMmg_5ffc6ad && \
cd /

# install PARMMG
RUN git clone https://github.com/MmgTools/ParMmg /tmp/ParMmg_5ffc6ad && \
mkdir /tmp/ParMmg_5ffc6ad/build && \
mkdir -p /external_libraries/ParMmg_5ffc6ad && \
cd /tmp/ParMmg_5ffc6ad/build && git checkout 5ffc6ada4afb1af50a43e1fa6f4c409cff2ea25c && \
cmake .. -DCMAKE_RULE_MESSAGES=OFF -DCMAKE_C_FLAGS="-w" -DCMAKE_CXX_FLAGS="-w" -DCMAKE_INSTALL_PREFIX="/external_libraries/ParMmg_5ffc6ad" -DUSE_SCOTCH=OFF -DLIBPARMMG_SHARED=ON -DDOWNLOAD_MMG=OFF -DMMG_DIR="/tmp/mmg_5_5_1" -DMMG_BUILDDIR="/tmp/mmg_5_5_1/build" -DDOWNLOAD_METIS=OFF -DMETIS_DIR="/usr/include" && \
make -j2 install && \
rm -r /tmp/mmg_5_5_1 && \
rm -r /tmp/ParMmg_5ffc6ad && \
cd / && \
# remove some now unnecessary packages
apt-get -y remove \
cd /

# Install Boost (form zip)
RUN mkdir -p /workspace/boost && \
wget -P /workspace/boost https://archives.boost.io/release/1.87.0/source/boost_1_87_0.tar.gz && \
tar -C /workspace/boost -xzf /workspace/boost/boost_1_87_0.tar.gz && \
rm /workspace/boost/boost_1_87_0.tar.gz

# Remove unnecessary packages
RUN apt-get -y remove \
gnupg2 \
software-properties-common \
wget && \
Expand Down
61 changes: 0 additions & 61 deletions scripts/docker_files/docker_file_ci_ubuntu_bionic/DockerFile

This file was deleted.

This file was deleted.

Loading