Docker (un)install scripts

This commit is contained in:
Anthony Axenov 2022-08-25 12:40:21 +08:00
parent aaf88521b3
commit c48971a858
Signed by: anthony
GPG Key ID: EA9EC32FF7CCD4EC
2 changed files with 27 additions and 2 deletions

View File

@ -9,18 +9,19 @@ echo
# https://docs.docker.com/engine/install/ubuntu/ # https://docs.docker.com/engine/install/ubuntu/
sudo apt remove -y docker docker-engine docker.io containerd runc
sudo apt-get install \ sudo apt-get install \
ca-certificates \ ca-certificates \
curl \ curl \
gnupg \ gnupg \
lsb-release lsb-release
sudo mkdir -p /etc/apt/keyrings sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \ echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ "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 $(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 chmod a+r /etc/apt/keyrings/docker.gpg
sudo apt update sudo apt update
sudo apt install -y --autoremove \ sudo apt install -y --autoremove \
docker-ce \ docker-ce \
@ -29,6 +30,9 @@ sudo apt install -y --autoremove \
docker-compose-plugin \ docker-compose-plugin \
docker-compose docker-compose
sudo usermod -aG docker anthony sudo usermod -aG docker anthony
echo 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 echo

21
uninstall/docker Executable file
View File

@ -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