Atualizando os pacotes
apt -y update && apt -y upgrade
Verifique se uma reinicialização é necessária após a atualização
[ -f /var/run/reboot-required ] && reboot -f
Repositório estável oficial do Docker
apt install lsb-release gnupg2 apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/trusted.gpg.d/debian.gpg
add-apt-repository "deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/debian $(lsb_release -cs) stable"
Instalando o Docker
apt update && apt install docker-ce docker-ce-cli containerd.io docker-compose-plugin
Verifique se o serviço Docker foi iniciado:
systemctl start docker && systemctl enable docker
Teste
docker run hello-world
