From c48971a858ca7daab1d45f403b1fb86859c34155 Mon Sep 17 00:00:00 2001 From: AnthonyAxenov Date: Thu, 25 Aug 2022 12:40:21 +0800 Subject: [PATCH] Docker (un)install scripts --- install/docker | 8 ++++++-- uninstall/docker | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) create mode 100755 uninstall/docker diff --git a/install/docker b/install/docker index 9e49e33..44a99d1 100755 --- a/install/docker +++ b/install/docker @@ -9,18 +9,19 @@ echo # https://docs.docker.com/engine/install/ubuntu/ -sudo apt remove -y docker docker-engine docker.io containerd runc 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 chmod a+r /etc/apt/keyrings/docker.gpg + sudo apt update sudo apt install -y --autoremove \ docker-ce \ @@ -29,6 +30,9 @@ sudo apt install -y --autoremove \ docker-compose-plugin \ docker-compose sudo usermod -aG docker anthony + echo -echo "You need to logout and log in again to apply docker group" +echo "Finish!" +echo "Probably, you need to relogin to apply 'docker' group." +echo "Your ones currently are: $(groups)" echo diff --git a/uninstall/docker b/uninstall/docker new file mode 100755 index 0000000..bf2b57b --- /dev/null +++ b/uninstall/docker @@ -0,0 +1,21 @@ +#!/bin/bash +##makedesc: Uninstall docker + +echo +echo "===============================================" +echo "Uninstalling docker..." +echo "===============================================" +echo + +# sudo apt remove -y docker docker-engine docker.io containerd runc +sudo apt remove -y \ + containerd \ + containerd.io \ + docker \ + docker-ce \ + docker-ce-cli \ + docker-compose \ + docker-compose-plugin \ + docker-engine \ + docker.io \ + runc