Skip to content

Instantly share code, notes, and snippets.

@valdineireis
Created July 29, 2022 03:40
Show Gist options
  • Save valdineireis/a84c6ef52ae888b3073b473132e20252 to your computer and use it in GitHub Desktop.
Save valdineireis/a84c6ef52ae888b3073b473132e20252 to your computer and use it in GitHub Desktop.
Instala o Docker em um Ubuntu e cria um container de exemplo
#!/bin/bash
echo "Instalando o Docker......."
apt-get update -y
apt-get install ca-certificates curl gnupg lsb-release -y
mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) 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-compose-plugin -y
echo "Criando o container......."
docker run --name apache-A -d -p 80:80 --volume=/site:/usr/local/apache2/htdocs/ httpd
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment