-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathsetupdocker.txt
More file actions
52 lines (39 loc) · 1.55 KB
/
setupdocker.txt
File metadata and controls
52 lines (39 loc) · 1.55 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
#!/bin/sh
set -e
#
# This script is meant for quick & easy install via:
# 'curl -sSL https://healthcatalyst.github.io/InstallScripts/setupdocker.txt | sh'
# or:
# 'wget -qO- https://healthcatalyst.github.io/InstallScripts/setupdocker.txt | sh'
#
#
echo "setupdocker version 1.05"
# remove the line from next run
grep -v "curl -sSL https://healthcatalyst.github.io/InstallScripts/setupdocker.txt | sh" ~/.bashrc | sudo tee ~/.bashrc
sudo systemctl enable docker.service
sudo systemctl enable docker
sudo systemctl start docker
docker run --rm hello-world
echo "docker is setup now"
# echo "setting up a cleanup job"
# echo "0 2 * * * /bin/sh backup.sh" | sudo tee -a /etc/cron.d/docker_cleanup > /dev/null
# (crontab -l ; echo "@daily /.sh") | sort - | uniq - | crontab -
appinsightskey=""
read -p "Please enter the Application Insights key provided to you by Health Catalyst:" -e appinsightskey < /dev/tty
if [[ ! -z "$appinsightskey" ]]
then
docker stop appinsights || echo 'no container to stop'
docker rm appinsights || echo 'no container to remove'
docker pull microsoft/applicationinsights
docker run -v /var/run/docker.sock:/docker.sock -d --name appinsights microsoft/applicationinsights ikey="$appinsightskey"
fi
doSetupSwarm=""
read -e -p "Do you wish to setup docker swarm cluster now?" yn < /dev/tty
case $yn in
[Yy]* ) doSetupSwarm="yes"; break;;
[Nn]* ) break;;
* ) echo "Please answer yes or no.";;
esac
if [[ ! -z "$doSetupSwarm" ]]; then
curl -sSL https://healthcatalyst.github.io/InstallScripts/docker/joinswarm.txt | sh
fi