-
Notifications
You must be signed in to change notification settings - Fork 6
/
essentials.sh
executable file
·104 lines (82 loc) · 2.86 KB
/
essentials.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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#!/bin/bash
clear
echo "
___ ____ _ _ ____ _ _ _ ____ ___ ____ _ _ ____ ____
/ |___ | | [__ | |\ | [__ | |__| | | |___ |__/
/__ |___ |__| ___] | | \| ___] | | | |___ |___ |___ | \
"
#This is a script to install essential and or useful programs for Docker.
#A list is provided below, as well as on the Github Page with the included programs.
#This script is designed to add the containers after installing Docker from this repo. If your docker-compose.yml file is located elsewhere, you will need to change the location in the script so the containers are added.
## Included Containers:
# Portainer -Container manager for docker (ESSENTIAL)
# Pi-Hole -DNS sinkhole; ad and telemetry adblocker
###########################################################################################
#Install Portainer
echo "Would you like to install Portainer (HIGHLY RECOMMENDED)? (y/n/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
echo "portainer:
container_name: portainer
restart: unless-stopped
ports:
- 9000:9000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
- /home/dockeras/portainer:/data
environment:
- PUID=1000
- PGID=150
- TZ=US/Eastern
image: portainer/portainer-ce" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >>/home/$USER/raspi-docker/docker-compose.yml #replace this location with the location docker-compose.yml if needed.
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
#############################################################
echo "Would you like to install Yacht (Alternative to Portainer)? (y/n/e)"
read -n1 yesorno
if [ "$yesorno" = y ]; then
mkdir /home/$USER/raspi-docker &> /dev/null
mkdir /home/$USER/raspi-docker/yacht
echo "---
version: "3"
services:
yacht:
container_name: yacht
restart: unless-stopped
ports:
- 8000:8000
volumes:
- /home/$USER/raspi-docker/yacht:/config
- /var/run/docker.sock:/var/run/docker.sock
image: selfhostedpro/yacht" >> /home/$USER/raspi-docker/docker-compose.yml #replace /home/$USER/raspi-docker/docker-compose.yml with the location of your docker-compose.yml file
echo " " >>/home/$USER/raspi-docker/docker-compose.yml #replace this location with the location docker-compose.yml if needed.
echo " "
echo "Successfully Added"
elif [ "$yesorno" = n ]; then
echo " "
echo "Skipping..."
elif [ "$yesorno" = e ]; then
echo " "
echo "Goodbye!"
exit 1
else
echo " "
echo "Not a valid answer. Exiting..."
exit 1
fi
echo " "
echo " "
echo "Script Complete. Goodbye!"