-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
47 lines (38 loc) · 1.41 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/bin/bash
set -e
# Atualiza o sistema operacional e instala pacotes necessários
sudo apt update && sudo apt upgrade -y
sudo apt-get install -y \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# Adiciona a chave GPG oficial do Docker
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
# Configura o repositório do Docker
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
# Atualiza a lista de pacotes do sistema e instala o Docker
sudo apt update
sudo apt install -y docker-ce docker-ce-cli containerd.io
# Verifica se Docker está em execução
if docker -v > /dev/null 2>&1; then
echo "Docker is installed."
else
echo "Unable to start Docker. Your system does not seem to use systemd or WSL."
fi
# Adiciona o usuário atual ao grupo do Docker
sudo usermod -aG docker $USER && newgrp docker
# Instala o Docker Compose
sudo apt update
sudo apt install -y docker-compose
# Força início do Docker
sudo service docker start
# Verifica se o Docker Compose foi instalado corretamente
if docker-compose -v > /dev/null 2>&1; then
echo "Docker Compose is installed."
else
echo "Unable to install Docker Compose."
fi