File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change 2
2
#
3
3
# Command Line Interface to start all services associated with the Getting-Started Tutorial
4
4
#
5
- # For this tutorial the commands are merely a convenience script to run docker-compose
6
- #
5
+ # For this tutorial the commands are merely a convenience script to run ${dockerCmd}#
7
6
8
7
set -e
9
8
10
- if (( $# != 1 )) ; then
11
- echo " Illegal number of parameters"
9
+ dockerCmd=" docker compose"
10
+ if (( $# == 2 )) ; then
11
+ dockerCmd=" docker-compose"
12
+ fi
13
+
14
+ if (( $# < 1 )) ; then echo " Illegal number of parameters"
12
15
echo " usage: services [create|start|stop]"
13
16
exit 1
14
17
fi
15
18
16
19
17
20
stoppingContainers () {
18
21
echo " Stopping running containers"
19
- docker-compose down -v --remove-orphans
22
+ ${dockerCmd} down -v --remove-orphans
20
23
}
21
24
22
25
displayServices () {
@@ -36,7 +39,7 @@ case "${command}" in
36
39
stoppingContainers
37
40
echo -e " Starting containers: including \033[1;35mFogFlow\033[0m, an \033[1mNGINX\033[0m instance, and \033[1mRabbitMQ\033[0m message broker."
38
41
echo " "
39
- docker-compose up -d --remove-orphans
42
+ ${dockerCmd} up -d --remove-orphans
40
43
displayServices
41
44
;;
42
45
" stop" )
@@ -47,7 +50,7 @@ case "${command}" in
47
50
export $( cat .env | grep " #" -v)
48
51
echo " Pulling Docker images"
49
52
docker pull curlimages/curl
50
- docker-compose pull
53
+ ${dockerCmd} pull
51
54
;;
52
55
* )
53
56
echo " Command not Found."
You can’t perform that action at this time.
0 commit comments