Skip to content

Instantly share code, notes, and snippets.

@elinardo10
Created September 4, 2024 03:41
Show Gist options
  • Save elinardo10/e82f0057b47e3b44edd34253770204b0 to your computer and use it in GitHub Desktop.
Save elinardo10/e82f0057b47e3b44edd34253770204b0 to your computer and use it in GitHub Desktop.
Instalando docker e docker composer
#!/bin/bash#
# Recipe Name: Install Docker and Docker-Compose
# Run as user: root
# Recipe:
sudo apt update
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Focal = Ubuntu 22
# Run `lsb_release -cs` to discover yours if not 22
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"
apt-cache policy docker-ce
apt install -y docker-ce
systemctl status docker
usermod -aG docker forge
COMPOSE_VERSION=$(curl -s https://api.github.com/repos/docker/compose/releases/latest | grep 'tag_name' | cut -d\" -f4)
sh -c "curl -L https://github.com/docker/compose/releases/download/${COMPOSE_VERSION}/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose"
chmod +x /usr/local/bin/docker-compose
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment