summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xdocker-ubuntu.sh26
-rwxr-xr-xdocker.sh (renamed from docker-debian.sh)20
2 files changed, 11 insertions, 35 deletions
diff --git a/docker-ubuntu.sh b/docker-ubuntu.sh
deleted file mode 100755
index cba39d8..0000000
--- a/docker-ubuntu.sh
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/bash
-#
-
-sudo apt-get update
-sudo apt-get install \
- ca-certificates \
- curl \
- gnupg \
- lsb-release
-
-sudo mkdir -p /etc/apt/keyrings
-curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
-echo \
- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
- $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-
-sudo apt-get update
-
-sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
-
-sudo usermod -G docker $USER
-
-exec sg docker "newgrp `id -gn`"
-
-sudo curl -L https://github.com/docker/compose/releases/download/v2.15.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
-sudo chmod +x /usr/local/bin/docker-compose
diff --git a/docker-debian.sh b/docker.sh
index fd7b0a8..ceb60b7 100755
--- a/docker-debian.sh
+++ b/docker.sh
@@ -1,26 +1,28 @@
#!/bin/bash
#
-sudo apt-get update
-sudo apt-get install \
+
+version=$(cat /etc/issue.net | awk '{print tolower($1)}')
+
+sudo apt update
+sudo apt install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
-curl -fsSL https://download.docker.com/linux/debian/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
-
+curl -fsSL https://download.docker.com/linux/$version/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
- "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian \
+ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/$version \
$(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
-sudo apt-get update
+sudo apt update
-sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
+sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
sudo usermod -G docker $USER
-exec sg docker "newgrp `id -gn`"
-
sudo curl -L https://github.com/docker/compose/releases/download/v2.15.0/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
+
+exec sg docker "newgrp `id -gn`"