-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathDockerfileWE
103 lines (75 loc) · 2.71 KB
/
DockerfileWE
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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
FROM simcenter-common
SHELL ["/bin/bash", "-c"]
WORKDIR /simcenter
#
# Install cmake needed for VTK
#
RUN sudo apt remove cmake -y \
&& sudo apt purge --auto-remove cmake -y \
&& sudo apt-get install -y wget \
&& wget http://www.cmake.org/files/v3.15/cmake-3.15.0.tar.gz \
&& tar xf cmake-3.15.0.tar.gz \
&& cd cmake-3.15.0 \
&& ./configure \
&& make \
&& sudo make install \
&& rm -fr /simcenter/cmake*
#
# Install VTK needed for WE-UQ frontend
#
RUN wget https://www.vtk.org/files/release/9.2/VTK-9.2.6.tar.gz \
&& tar -zxBf VTK-9.2.6.tar.gz \
&& cd VTK-9.2.6; mkdir build; cd build \
&& source /opt/qt515/bin/qt515-env.sh \
&& cmake .. \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DBUILD_SHARED_LIBS:BOOL=ON \
-DVTK_GROUP_ENABLE_Qt=YES -DVTK_VTK_Group_Qt=YES \
-DVTK_MODULE_ENABLE_VTK_GUISupportQt=YES \
-DQt5_DIR:PATH=/usr/local/qt/lib/cmake/Qt5 \
&& make \
&& sudo make install \
&& rm -fr /simcenter/VTK*
#
# Build WE-UQ frontend
# && git clone -b $versionEE --single-branch https://github.com/NHERI-SimCenter/WE-UQ.git \
RUN source /opt/qt515/bin/qt515-env.sh \
&& git clone --depth 1 --branch master https://github.com/NHERI-SimCenter/SimCenterCommon.git \
&& git clone --depth 1 --branch master https://github.com/NHERI-SimCenter/WE-UQ.git \
&& cd WE-UQ \
&& mkdir build \
&& cd build \
&& conan install .. --build missing \
&& source /opt/qt515/bin/qt515-env.sh \
&& qmake "QMAKE_CXXFLAGS+=-D_SC_RELEASE" ../WE-UQ.pro \
&& make \
&& rm -fr .obj *.o *.cpp \
&& rm -fr /simcenter/SimCenterCommon
#
# Install openfoam - version 10
# NOTE: missing adding source /opt/openfoam10/etc/bashrc into bashrc
# ===> will add to application
#
RUN sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key > /etc/apt/trusted.gpg.d/openfoam.asc" \
&& sudo add-apt-repository http://dl.openfoam.org/ubuntu \
&& sudo apt-get update \
&& sudo apt-get -y install openfoam10
#
# Copy all files into correct locations for running & clean up
#
RUN cd WE-UQ/build \
&& cp -r ../Examples ./ \
&& cp -r ../../SimCenterBackendApplications/applications . \
&& rm -fr /simcenter/SimCenterBackendApplications \
&& rm -fr /simcenter/SimCenterCommon
#
# add following for the missing lib libQt5Core.so error that is related to running on some versions linux
# with an older kernel, seemingly need kernel >= 3.5 on host .. soln from Sal T. found in an AskUbuntu thread
#
RUN strip --remove-section=.note.ABI-tag /opt/qt515/lib/libQt5Core.so.5
#
# Finally add a new user simcenter as root cannot run the Qt app
#
RUN useradd -ms /bin/bash simcenter
USER simcenter