-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvagrant.sh
executable file
·43 lines (38 loc) · 1.18 KB
/
vagrant.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
#!/bin/bash
function printTitle() {
echo "-[ $1 ]-"
}
# Docker Install
function dockerInstall() {
printTitle "Docker Install"
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
apt-get update
apt-get upgrade
apt-get -y install apt-transport-https ca-certificates vim curl gnupg2 software-properties-common docker-ce docker-ce-cli containerd.io docker-compose
usermod -aG docker vagrant
cat > /etc/docker/daemon.json <<EOF
{
"exec-opts": ["native.cgroupdriver=systemd"],
"log-driver": "json-file",
"log-opts": {
"max-size": "100m"
},
"storage-driver": "overlay2",
"insecure-registries" : ["docker-registry.local"]
}
EOF
mkdir -p /etc/systemd/system/docker.service.d
systemctl daemon-reload
systemctl restart docker
}
# main
function main() {
dockerInstall
docker-compose -f /vagrant/docker-compose.yml up -d
}
main
printTitle "Finished!"
echo -e
echo -e "Update your /etc/hosts local file with: $(ip addr show eth1 | grep inet | grep eth1 | awk '{print $2}' | cut -d '/' -f1) docker-registry.local"
echo -e