forked from olovm/cora-eclipse
-
Notifications
You must be signed in to change notification settings - Fork 0
/
buildEclipseForCora.sh
executable file
·45 lines (42 loc) · 1.61 KB
/
buildEclipseForCora.sh
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
#! /bin/bash
USER=$1
USERID=$2
DOCKERGROUPID=$3
NOCACHE=$4
echo "running buildEclipseForCora.sh..."
echo "Testing for container runtimes...."
CONTAINERRUNTIME=podman;
DOCKER_EXISTS=$(command -v docker)
echo "Docker size: "${#DOCKER_EXISTS}
if [ ${#DOCKER_EXISTS} -gt 0 ]; then
CONTAINERRUNTIME=docker;
fi
echo "Container runtime will be "${CONTAINERRUNTIME}
if [ ! $USER ]; then
echo you must specify the userName to be used when building eclipse202309forcora2
elif [ ! $USERID ]; then
echo you must specify the userid to be used when building eclipse202309forcora2, use: id -u youruserid
elif [ ! $DOCKERGROUPID ]; then
echo you must specify the dockergroupid to be used when building eclipse202309forcora2, use: getent group docker
else
#for possibly newer version of from: X
#docker build --pull --no-cache --build-arg user=$USER --build-arg dockergroupid=$DOCKERGROUPID -t eclipseforcoraoxygen2 cora-eclipse/docker/
# --no-cache \
if [ ! $NOCACHE ]; then
${CONTAINERRUNTIME} build \
--build-arg user=$USER \
--build-arg userid=$USERID \
--build-arg dockergroupid=$DOCKERGROUPID \
-t eclipse202309forcora2 cora-eclipse/docker/
else
${CONTAINERRUNTIME} build --no-cache --pull \
--build-arg user=$USER \
--build-arg userid=$USERID \
--build-arg dockergroupid=$DOCKERGROUPID \
-t eclipse202309forcora2 cora-eclipse/docker/
fi
#${CONTAINERRUNTIME} build --build-arg user=$USER -t eclipseforcoraoxygen2 cora-eclipse/docker/
#cd cora-eclipse/docker/
#docker-compose build --build-arg user=$USER eclipseforcoraoxygen2
#docker-compose build --no-cache --build-arg user=$USER eclipseforcoraoxygen2
fi