forked from chadit/dotfiles_old
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall_docker.sh
executable file
·76 lines (55 loc) · 2.03 KB
/
install_docker.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
#!/bin/bash
# Docker Setup from source
func ()
{
# change directory to tmp
cd /tmp/
#dependancies
local pplatform=$(python -mplatform)
echo $pplatform
if [[ $pplatform == *"fedora"* ]]; then
platform="Fedora"
fi
if [[ $pplatform == *"Ubuntu"* ]]; then
platform="Ubuntu"
fi
case "$platform" in
"Fedora")
echo "run fedora stuff"
sudo dnf install -y curl
;;
"Ubuntu")
echo "run ubuntu stuff"
sudo apt install -y curl
;;
esac
# todo find a way to scrap the version from the web pay so we can check if it needs updated
local FILETAR="docker-17.07.0-ce.tgz"
curl -O https://download.docker.com/linux/static/edge/x86_64/${FILETAR}
sudo tar xzvf ${FILETAR}
sudo cp docker/* /usr/bin/
curl -O https://gist.githubusercontent.com/chadit/7786b27e0d61b8bb66562da11d7d94b1/raw/c8da092c66a12202347cc76c0b274d4b6125ea9e/docker.service
sudo mkdir -p /usr/lib/systemd/system
sudo cp docker.service /usr/lib/systemd/system/
sudo curl -L "https://dl.bintray.com/docker-compose/master/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
sudo chmod +x /usr/bin/docker-compose
local SCRIPTUSER=${SUDO_USER}
if test "$SCRIPTUSER" = "" || test "$SCRIPTUSER" = "root"; then
SCRIPTUSER=${USER}
fi
echo "user set to $SCRIPTUSER"
sudo systemctl start docker.service
sudo systemctl enable docker.service
sudo groupadd docker
sudo usermod -aG docker ${SCRIPTUSER}
sudo rm -rf docker*
}
func
# To install, run the following commands as root:
#curl -fsSLO https://get.docker.com/builds/Linux/x86_64/docker-17.04.0-ce.tgz && tar --strip-components=1 -xvzf docker-17.04.0-ce.tgz -C /usr/bin
# Then start docker in daemon mode:
#/usr/bin/dockerd
# docker compose
# curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
# curl -L "https://dl.bintray.com/docker-compose/master/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
# chmod +x /usr/bin/docker-compose