Skip to content

Commit e667264

Browse files
committed
Updating for Docker
1 parent dd71124 commit e667264

File tree

4 files changed

+45
-41
lines changed

4 files changed

+45
-41
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,6 @@ This will install Git on your machine!
2828
|Python 3|Yes|Yes|Yes |Yes|Yes|No |https://installer.to/python3|
2929
|Nginx |Yes|Yes|Yes |Yes|Yes|No |https://installer.to/nginx |
3030
|gCloud |No |No |No |No |No |Yes |https://installer.to/gcloud |
31+
|Docker |Yes|Yes|No |No |No |No |https://installer.to/docker |
3132

3233
<!-- end of tools list -->

installers.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,8 @@ installers = "apt,yum,pacman,apk,dnf"
2626
name = "gCloud"
2727
description = "CLI tool of GCP"
2828
installers = "curl"
29+
30+
[docker]
31+
name = "Docker"
32+
description = "Docker"
33+
installers = "apt,yum"

installers/docker/installer.sh

Lines changed: 35 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/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
2+
3+
CURL_CMD=$(which curl)
4+
YUM_CMD=$(which yum)
5+
DNF_CMD=$(which dnf)
6+
APT_GET_CMD=$(which apt-get)
7+
PACMAN_CMD=$(which pacman)
8+
APK_CMD=$(which apk)
9+
GIT_CMD=$(which git)
10+
SUDO_CMD=$(which sudo)
1111

1212
USER="$(id -un 2>/dev/null || true)"
1313
SUDO=''
@@ -23,43 +23,37 @@ if [ "$USER" != 'root' ]; then
2323
fi
2424
fi
2525

26+
RESET=''
27+
RED=''
28+
GREEN=''
29+
YELLOW=''
30+
log () {
31+
echo "[`date "+%Y.%m.%d-%H:%M:%S%Z"`]$1 $2"
32+
}
33+
info () {
34+
log "$GREEN INFO$RESET $1"
35+
}
36+
warn () {
37+
log "$YELLOW WARN$RESET $1"
38+
}
39+
error () {
40+
log "$RED ERROR$RESET $1"
41+
}
42+
2643
if [ ! -z $APT_GET_CMD ]; then
2744
$SUDO apt-get update
28-
$SUDO apt-get install \
29-
apt-transport-https \
30-
ca-certificates \
31-
curl \
32-
gnupg-agent \
33-
software-properties-common
34-
35-
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
36-
37-
$SUDO add-apt-repository \
38-
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
39-
$(lsb_release -cs) \
40-
stable"
41-
42-
$SUDO apt-get update
43-
44-
$SUDO apt-get install docker-ce docker-ce-cli containerd.io
45-
45+
$SUDO apt-get install apt-get install apt-transport-https ca-certificates curl gnupg-agent software-properties-common
46+
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
47+
$SUDO add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
48+
$SUDO apt-get update
49+
$SUDO apt-get install docker-ce docker-ce-cli containerd.io
50+
4651
elif [ ! -z $YUM_CMD ]; then
4752
$SUDO yum install -y yum-utils
48-
$SUDO yum-config-manager \
49-
--add-repo \
50-
https://download.docker.com/linux/centos/docker-ce.repo
53+
$SUDO yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
5154
$SUDO yum install docker-ce docker-ce-cli containerd.io
52-
53-
# elif [ ! -z $PACMAN_CMD ]; then
54-
# pacman -Sy git
55-
56-
# elif [ ! -z $DNF_CMD ]; then
57-
# $SUDO dnf install git
58-
59-
# elif [ ! -z $APK_CMD ]; then
60-
# $SUDO apk add git
61-
55+
6256
else
6357
echo "Couldn't install package"
6458
exit 1;
65-
fi
59+
fi

installers/docker/installer.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
name = "Docker"
2+
shortname = "docker"
3+
description = "Docker"
4+
15
[apt]
26
sh = """
37
@sudo apt-get update

0 commit comments

Comments
 (0)