-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdocker_run.sh
More file actions
executable file
·30 lines (24 loc) · 1.01 KB
/
Copy pathdocker_run.sh
File metadata and controls
executable file
·30 lines (24 loc) · 1.01 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
#!/bin/sh
## Script to start and stop design-sphere docker container
## Usage: docker_run start|stop
echo "Running command [ $0 $@ ] "
if [[ $1 == "start" ]]; then
# Remove existing container
echo "\n# [ Removing existing stopped containers of name ds-container ]"
docker container rm ds-container
# Remove all the design-sphere related images
# echo "\n# [ Removing docker image with label 'ds' ]"
# docker image prune --all --force --filter label=image="ds"
# Copy, build the app and create a docker image tagger `ds-server`
echo "\n# [ Building docker image ds-server]"
docker build -t ds-server .
# Run the docker container with name `ds-container`
echo "\n# [ Starting docker image ds-server in container ds-container ]"
docker run -dp 127.0.0.1:8080:8080 --name ds-container ds-server
elif [[ $1 == "stop" ]]; then
echo "\n# [ Stopping docker container ]"
docker container stop ds-container
else
echo "\nUsage: ./docker_run start|stop\n"
fi
echo "\n# [ Done ]"