-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
85 lines (69 loc) · 3.15 KB
/
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
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
# Base image with dependencies
FROM ubuntu:18.04 AS base
ENV DEBIAN_FRONTEND noninteractive
ENV TZ=Europe/Berlin
# Package dependencies
RUN apt-get -y update && apt-get -y upgrade && \
apt-get -y install \
rsync bash git wget fuse \
cmake build-essential autotools-dev autoconf pkg-config \
g++ gfortran gdb gdbserver \
libpthread-stubs0-dev python \
xorg mesa-common-dev libgl1-mesa-glx libgl1-mesa-dev libglu1-mesa-dev freeglut3-dev mesa-utils && \
rm -rf /var/lib/apt/lists/*
# User and FUSE
ARG UID=1000
ARG GID=1000
RUN groupadd -g "${UID}" pvbuilder && \
useradd -r -u "${GID}" -g pvbuilder pvbuilder && \
mkdir -p /app && \
chown -R pvbuilder:pvbuilder /app && \
groupadd fuse && \
usermod -a -G fuse pvbuilder
USER pvbuilder
# Paraview Superbuild
RUN cd /app && \
git clone --recursive https://gitlab.kitware.com/paraview/paraview-superbuild.git && \
cd paraview-superbuild && \
git fetch origin && git checkout v5.8.0 && git submodule update
# Download and precompile sources
RUN mkdir -p /app/paraview-build && \
cd /app/paraview-build && \
cmake --parallel=$(nproc) ../paraview-superbuild -DENABLE_xdmf3=1 -DENABLE_python3=1 -DENABLE_matplotlib=1 -DENABLE_numpy=1 \
-DENABLE_qt5=1 -DENABLE_mpi=1 -DENABLE_hdf5=1 && \
make download-all && \
find /app/paraview-build -mindepth 1 -maxdepth 1 ! -name 'downloads' -exec rm -rf {} \;
# Image for release image
FROM base AS release
# Dependencies
RUN cd /app && \
wget "https://github.com/AppImage/AppImageKit/releases/download/12/appimagetool-x86_64.AppImage" && \
chmod +x appimagetool-x86_64.AppImage
RUN cd /app/paraview-build && \
cmake --parallel=$(nproc) ../paraview-superbuild -DENABLE_xdmf3=1 -DENABLE_python3=1 -DENABLE_matplotlib=1 -DENABLE_numpy=1 \
-DENABLE_qt5=1 -DENABLE_mpi=1 -DENABLE_hdf5=1 -DCMAKE_BUILD_TYPE=Release && \
make download-all && \
rm -rf superbuild/paraview/src/VTK && \
git clone --single-branch --branch="xdmf3-highorder" --depth=1 https://gitlab.kitware.com/ChristophHonal/vtk.git superbuild/paraview/src/VTK && \
make -j$(nproc)
# Pack assets
COPY tools/AppRun tools/paraview-xdmf3-highorder.desktop tools/paraview-xdmf3-highorder.png /app/paraview-build/install/
COPY tools/paraview-xdmf3-highorder.appdata.xml /app/paraview-build/install/usr/share/metainfo/
# Update and repompile git VTK and pack AppImage
COPY tools/release.sh /app/
ENTRYPOINT [ "/app/release.sh" ]
# Image for debugging
FROM base as debug
# Reconfigure and recompile for debugging
RUN cd /app/paraview-build && \
cmake --parallel=$(nproc) ../paraview-superbuild -DENABLE_xdmf3=1 -DENABLE_python3=1 -DENABLE_matplotlib=1 -DENABLE_numpy=1 \
-DENABLE_qt5=1 -DENABLE_mpi=1 -DENABLE_hdf5=1 -DSUPERBUILD_ALLOW_DEBUG=1 -DCMAKE_BUILD_TYPE_paraview=Debug && \
make download-all && \
rm -rf superbuild/paraview/src/VTK && \
git clone --single-branch --branch="xdmf3-highorder" --depth=1 https://gitlab.kitware.com/ChristophHonal/vtk.git superbuild/paraview/src/VTK && \
make -j$(nproc)
# GDB server
EXPOSE 2000
# Recompile sources
COPY tools/debug.sh /app/
ENTRYPOINT [ "/app/debug.sh" ]