Skip to content

Commit 8b0e9c8

Browse files
committed
added Docker-compose on apt-get and yum
1 parent 4a46ca1 commit 8b0e9c8

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ This will install Git on your machine!
2626
| Docker | 👍 | 👍 | WIP | WIP | https://installer.to/docker |
2727
| Kubectl | 👍 | WIP | WIP | WIP | https://installer.to/kubectl |
2828
| NVM | WIP | WIP | WIP | WIP | https://installer.to/nvm |
29+
| Docker Compose | 👍 | 👍 | WIP | WIP | https://installer.to/docker-compose |
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/sh
2+
3+
CURL_CMD=$(which curl) # curl tool
4+
YUM_CMD=$(which yum) # yum package manager for RHEL & CentOS
5+
DNF_CMD=$(which dnf) # dnf package manager for new RHEL & CentOS
6+
APT_GET_CMD=$(which apt-get) # apt package manager for Ubuntu & other Debian based distributions
7+
PACMAN_CMD=$(which pacman) # pacman package manager for ArchLinux
8+
APK_CMD=$(which apk) # apk package manager for Alpine
9+
GIT_CMD=$(which git) # to build from source pulling from git
10+
SUDO_CMD=$(which sudo) # check if sudo command is there
11+
12+
USER="$(id -un 2>/dev/null || true)"
13+
SUDO=''
14+
if [ "$USER" != 'root' ]; then
15+
if [ ! -z $SUDO_CMD ]; then
16+
SUDO='sudo'
17+
else
18+
cat >&2 <<-'EOF'
19+
Error: this installer needs the ability to run commands as root.
20+
We are unable to find "sudo". Make sure its available to make this happen
21+
EOF
22+
exit 1
23+
fi
24+
fi
25+
26+
if [ ! -z $APT_GET_CMD ]; then
27+
$SUDO apt-get update
28+
$SUDO apt-get install curl
29+
$SUDO curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
30+
$SUDO chmod +x /usr/local/bin/docker-compose
31+
32+
elif [ ! -z $YUM_CMD ]; then
33+
$SUDO yum install curl
34+
$SUDO curl -L "https://github.com/docker/compose/releases/download/1.26.1/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
35+
$SUDO chmod +x /usr/local/bin/docker-compose
36+
37+
else
38+
echo "Couldn't install package"
39+
exit 1;
40+
fi

0 commit comments

Comments
 (0)