From a217c7e7fd64eb4c3656c8c8ad88dbd148f628f6 Mon Sep 17 00:00:00 2001 From: sevenfour Date: Mon, 15 Jul 2024 07:05:53 +0000 Subject: [PATCH] =?UTF-8?q?=D0=97=D0=B0=D0=B3=D1=80=D1=83=D0=B7=D0=B8?= =?UTF-8?q?=D1=82=D1=8C=20=D1=84=D0=B0=D0=B9=D0=BB=D1=8B=20=D0=B2=20=C2=AB?= =?UTF-8?q?/=C2=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 setup.sh diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..f8679e4 --- /dev/null +++ b/setup.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +# Обновляем информацию о пакетах +sudo apt update + +# Устанавливаем необходимые пакеты +sudo apt install -y apt-transport-https ca-certificates curl software-properties-common + +# Добавляем ключ GPG для Docker +curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - + +# Добавляем репозиторий Docker +sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable" + +# Обновляем информацию о пакетах с учетом нового репозитория +sudo apt update + +# Устанавливаем Docker +sudo apt install -y docker-ce + +# Проверяем статус Docker +sudo systemctl status docker --no-pager + +# Если Docker активен, продолжаем установку Docker Compose +if systemctl is-active --quiet docker; then + echo "Docker is active, proceeding with Docker Compose installation..." + + # Устанавливаем Docker Compose + sudo curl -L "https://github.com/docker/compose/releases/download/2.28.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose + + # Делаем Docker Compose исполняемым + sudo chmod +x /usr/local/bin/docker-compose + + # Проверяем версию Docker Compose + docker compose version + + # Выводим сообщение об успешной настройке Docker + echo "Docker настроен успешно" +else + echo "Docker не активен, проверьте установку Docker." +fi