forked from boutproject/docker-bout
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuildBOUT.sh
More file actions
executable file
·43 lines (36 loc) · 1.03 KB
/
buildBOUT.sh
File metadata and controls
executable file
·43 lines (36 loc) · 1.03 KB
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
#!/bin/bash
source ./shellfunc.sh ; echo ""
echo "------------------------------------------"
echo " Build BOUT++ image "
echo "------------------------------------------"
echo ""
echo "Enter Dockerfile name prefix"
read DOCKER_NAME
HOSTNAME=`hostname -s`
DOCKERFILE="$DOCKER_NAME.dkr"
IMAGE_NAME="$DOCKER_NAME-img"
SCR_NAME="/scr_eris/jleddy/projects/BOUT-docker/"
# CONTRIB_DIR="/opt/contrib"
#
# if [ ! -d ./contrib ]; then
# echo "contrib directory needs to be local for Dockerfile to accept"
# runcmd "cp -R $CONTRIB_DIR ."
# fi
if [ ! -d $SCR_NAME ];then
echo "Directory $SCR_NAME not found. Check build script"
exit
fi
echo "DOCKERFILE = $DOCKERFILE"
echo "IMAGE_NAME = $IMAGE_NAME"
echo "SCR_NAME = $SCR_NAME"
echo ""
#
# The -f gives the file name of the 'Dockerfile'
# The last argument sets the PATH to be used to find files in the
# 'Dockerfile' and to resolve the '-f' option
#
runcmd "sudo docker build -t '$IMAGE_NAME' -f $DOCKERFILE $SCR_NAME"
echo ""
echo "docker images:"
echo ""
sudo docker images