-
Notifications
You must be signed in to change notification settings - Fork 8
/
delete.sh
executable file
·38 lines (30 loc) · 1.38 KB
/
delete.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
#!/bin/bash -x
ORGANIZATION=${ORGANIZATION:-openkbs}
PROJECT=${PROJECT:-myproject}
APPLICATION_NAME=${PWD##*/}
APP_VERSION=${APP_VERSION:-1.0.0}
## Base image to build this container
FROM_BASE=${FROM_BASE:-centos:8}
imageTag=${imageTag:-"${ORGANIZATION}/${APPLICATION_NAME}"}
## Docker Registry (Private Server)
#REGISTRY_IMAGE=${REGISTRY_HOST}/${imageTag}
VERSION=${APP_VERSION}-$(date +%Y%m%d)
###################################################
#### ---- Top-level build-arg arguments ----
###################################################
MY_DIR=$(dirname "$(readlink -f "$0")")
###################################################
#### ---- Change this only to use your own ----
###################################################
baseDataFolder="$HOME/data-docker"
###################################################
#### **** Container package information ****
###################################################
## -- transform '-' and space to '_'
#instanceName=`echo $(basename ${imageTag})|tr '[:upper:]' '[:lower:]'|tr "/\-: " "_"`
instanceName=`echo $(basename ${imageTag})|tr '[:upper:]' '[:lower:]'|tr "/: " "_"`
echo "---------------------------------------------"
echo "---- Print Log for Container for ${imageTag}"
echo "---------------------------------------------"
#sudo docker rm -f $(docker ps 2>&1 | grep "reasoner-docker" | awk '{print $1}')
sudo docker rm -f ${instanceName}