-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker_build_all.sh
executable file
·31 lines (27 loc) · 1.27 KB
/
docker_build_all.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
#!/bin/bash
# Author: Joan Bohlman
# Peace Amoung Worlds
# Note: because systemd is wonky, you may need to launch postgres, memcached, httpd, and cachet_monitor using systemctl
if [ "$1" == "clear" ] ; then
read -p "Do you really want to remove all docker images and containers? [Y/n]: " CONFIRM
if [ "$CONFIRM" == "Y" ] ; then
docker stop $(docker ps -a -q) ; docker rm $(docker ps -a -q) ; docker rmi $(docker images -a -q)
else
echo "Doing nothing and exiting..."
exit 0
fi
else
if [ ! -d docker/files/docker-systemctl-replacement ] ; then
cd docker/files
git clone https://github.com/gdraheim/docker-systemctl-replacement.git
cd ../..
fi
echo "Building Cachet Docker Image"
docker build --rm -f docker/cachet/Dockerfile -t local/cachet .
echo "Running Cachet Docker Container"
docker run --name cachet -e container=docker -d -p 8080:80 local/cachet /bin/bash -c "systemctl default" --link
echo "Building Cachet-Monitor Docker Image"
docker build --rm -f docker/cachet-monitor/Dockerfile -t local/cachet-monitor .
echo "Running Cachet-Monitor Docker Image"
docker run --name cachet-monitor -e container=docker -d -p 8081:80 local/cachet-monitor /bin/bash -c "systemctl default" --link
fi