-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_dock.sh
More file actions
executable file
·74 lines (60 loc) · 1.4 KB
/
run_dock.sh
File metadata and controls
executable file
·74 lines (60 loc) · 1.4 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
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
#!/bin/bash
###############################################
# Author: SG Langer Jul 2021
# Purpose: put all the Docker commands to build/run
# ddw-gway in one easy place
#
# Notes: If you are building from scratch, run this whole thing
# If pulling from Docker hub, just run the RUN and EXEC lines
##########################################
clear
vmtype=$(sudo virt-what|grep virtualbox)
if [ $vmtype ] ; then
# Vbox
echo $vmtype
host="10.0.2.15"
#host="10.0.2.2"
else
# VMware
echo $vmtype
host="172.17.0.1"
fi
ROOT="/home/site"
image="jodogne/orthanc-plugins"
instance="plotter"
srvc="plotter"
case "$1" in
build)
# clone the plotter code and site direcotry structure
git clone https://github.com/sglanger/$srvc.git
# install as a service
# https://computingforgeeks.com/how-to-run-java-jar-application-with-systemd-on-linux/
sudo cp $ROOT/$srvc/$srvc.service /usr/lib/systemd/system/$srvc.service
sudo systemctl daemon-reload
sudo systemctl enable $srvc
# $0 start
;;
conn)
#sudo docker run -it $instance /bin/bash $image
sudo docker exec -it $instance /bin/bash
;;
restart)
$0 stop
$0 start
;;
status)
sudo systemctl status $srvc
;;
stop)
# stops but does not remove image from DOcker engine
sudo systemctl stop $srvc
;;
start)
sudo systemctl start $srvc
;;
*)
echo "invalid option"
echo "valid options: build/start/stop/status/conn"
exit
;;
esac