-
Notifications
You must be signed in to change notification settings - Fork 320
/
elmer.dockerfile
56 lines (49 loc) · 1.59 KB
/
elmer.dockerfile
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
# Set the base image to the latest LTS version of Ubuntu
FROM ubuntu:latest
# Set the working directory to /home
WORKDIR /home
# Create an apt configuration file to fix erroneous "hash sum mismatch" errors
RUN printf "Acquire::http::Pipeline-Depth 0;\nAcquire::http::No-Cache true;\nAcquire::BrokenProxy true;" \
>> /etc/apt/apt.conf.d/99fixbadproxy
ENV DEBIAN_FRONTEND="noninteractive"
# Add the necessary packages to compile Elmer/Ice
RUN apt update -o Acquire::CompressionTypes::Order::=gz && apt upgrade -y && apt install -y \
build-essential \
cmake \
git \
libblas-dev \
liblapack-dev \
libmumps-dev \
libparmetis-dev \
mpich \
sudo \
less \
unzip \
zip \
curl
# Clone the ElmerIce source code and compile Elmer/Ice
RUN git clone https://www.github.com/ElmerCSC/elmerfem elmer \
&& mkdir elmer/builddir \
&& cd elmer/builddir \
&& cmake /home/elmer \
-DCMAKE_INSTALL_PREFIX=/usr/local/Elmer-devel \
-DCMAKE_C_COMPILER=/usr/bin/gcc \
-DCMAKE_Fortran_COMPILER=/usr/bin/gfortran \
-DWITH_MPI:BOOL=TRUE -DWITH_Mumps:BOOL=TRUE \
-DWITH_Hypre:BOOL=FALSE -DWITH_Trilinos:BOOL=FALSE \
-DWITH_ELMERGUI:BOOL=FALSE -DWITH_ElmerIce:BOOL=TRUE \
-DWITH_LUA:BOOL=TRUE \
&& make \
&& make install \
&& rm -R /home/elmer
# Set the path
ENV PATH=$PATH:/usr/local/Elmer-devel/bin
ENV PATH=$PATH:/usr/local/Elmer-devel/share/elmersolver/lib
# Add user
ENV USER=glacier
RUN adduser --disabled-password --gecos '' ${USER} \
&& adduser ${USER} sudo \
&& echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
USER ${USER}
ENV HOME=/home/${USER}
WORKDIR ${HOME}