use docker install skript

This commit is contained in:
thealhu 2024-06-29 13:03:59 +02:00
parent cb63a7ee5a
commit bd5343ca70

View file

@ -4,22 +4,10 @@ if [ "$EUID" -ne 0 ]; then
echo -e "\e[31mERROR: This script must be run as root. Please switch to root using 'sudo -i' or 'su - root' and try again.\e[0m" echo -e "\e[31mERROR: This script must be run as root. Please switch to root using 'sudo -i' or 'su - root' and try again.\e[0m"
exit 1 exit 1
fi fi
if ! command -v docker &> /dev/null if ! systemctl status docker &> /dev/null; then
then
echo -e "\e[32mINFO: Install Docker...\e[0m" echo -e "\e[32mINFO: Install Docker...\e[0m"
# Add Docker's official GPG key: apt-get install curl -y
apt-get update -y curl -fsSL https://get.docker.com | bash
apt-get install ca-certificates curl -y
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get update -y
apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin -y
fi fi
echo -e "\e[32mINFO: Docker is installed!\e[0m" echo -e "\e[32mINFO: Docker is installed!\e[0m"
if [ -e "./TC2-BBS-mesh-docker/docker-compose.yaml" ]; then if [ -e "./TC2-BBS-mesh-docker/docker-compose.yaml" ]; then