-
-
Notifications
You must be signed in to change notification settings - Fork 47
/
trex.sh
41 lines (34 loc) · 1.21 KB
/
trex.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
#/bin/bash
# https://docs.docker.com/install/linux/docker-ce/ubuntu/
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Ensure Docker Daemon is running (Dependency)"
echo -e '\e[38;5;198m'"++++ "
if pgrep -x "dockerd" >/dev/null
then
echo -e '\e[38;5;198m'"++++ Docker is running"
else
echo -e '\e[38;5;198m'"++++ Ensure Docker is running.."
sudo bash /vagrant/docker/docker.sh
fi
docker stop trex
docker rm trex
yes | sudo docker system prune -a
yes | sudo docker system prune --volumes
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Docker build -t trex ."
echo -e '\e[38;5;198m'"++++ "
cd /vagrant/trex/trex-nodejs
docker build -t trex .
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Docker images --filter reference=trex"
echo -e '\e[38;5;198m'"++++ "
docker images --filter reference=trex
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Docker run -t -d -i -p 6001:6001 --name trex --rm trex"
echo -e '\e[38;5;198m'"++++ "
docker run -t -d -i -p 6001:6001 --name trex --rm trex
echo -e '\e[38;5;198m'"++++ "
echo -e '\e[38;5;198m'"++++ Docker ps -f name=trex"
echo -e '\e[38;5;198m'"++++ "
docker ps -f name=trex
echo -e '\e[38;5;198m'"++++ Open http://localhost:6001 in your browser"