-
Notifications
You must be signed in to change notification settings - Fork 1
/
buildImageOF240
executable file
·32 lines (26 loc) · 1.14 KB
/
buildImageOF240
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
#!/bin/sh
# ------------------------------------------------------------------ #
#
# Bash script to automatically build Docker Images
# Different OpenFOAM versions can be chosen and set in Dockerfile
# OpenFOAM is installed on Ubuntu 14.04 LTS Image
# OpenFOAM is not compiled on Docker but installed from binaries
# ubuntu4foam image is created once. After multiple OpenFOAM
# versions can be installed on top.
#
# ------------------------------------------------------------------ #
if [ ! "$(docker images | grep ubuntu4foam)" ]; then
echo "No Ubuntu Image with OpenFOAM dependencies found"
echo "Creating Docker Ubuntu image for OpenFOAM"
echo "++++++++++++++++++++++++++++++++++++++++++"
docker build -t ubuntu4foam --no-cache=true -f DockerfileUbuntu4foam .
fi
echo "Creating Docker OpenFOAM image"
echo "++++++++++++++++++++++++++++++++++++++++++"
foamUserDir="$HOME/OpenFOAM"
docker build --build-arg HUSER="$USER" -t of240 --no-cache=true .
echo "++++++++++++++++++++++++++++++++++++++++++"
if [ ! -d $foamUserDir ]; then
echo "Creating OpenFOAM dir ( $foamUserDir ) under user's home, on host";
mkdir -p $foamUserDir;
fi