summaryrefslogtreecommitdiff
path: root/docker.sh
diff options
context:
space:
mode:
Diffstat (limited to 'docker.sh')
-rwxr-xr-xdocker.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/docker.sh b/docker.sh
new file mode 100755
index 0000000..ceb60b7
--- /dev/null
+++ b/docker.sh
@@ -0,0 +1,28 @@
+#!/bin/bash
+#
+
+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/$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/$version \
+ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
+
+sudo apt update
+
+sudo apt install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin
+
+sudo usermod -G docker $USER
+
+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`"