Skip to content

Instantly share code, notes, and snippets.

@MexsonFernandes
Last active August 1, 2023 21:38
Show Gist options
  • Save MexsonFernandes/2c09eb90e38d27dc3fb95aec250846a9 to your computer and use it in GitHub Desktop.
Save MexsonFernandes/2c09eb90e38d27dc3fb95aec250846a9 to your computer and use it in GitHub Desktop.
Install Docker on Ubuntu 18.04 (without sudo mode docker cli setup)
#!/bin/bash
echo "Updating system..."
sudo apt update
echo "Installing dependencies..."
sudo apt install -y apt-transport-https ca-certificates curl software-properties-common
echo "Downloading data..."
sudo apt install -y curl
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
echo "Setting up system..."
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
sudo apt install -y docker-ce
echo "Setting up docker run without sudo..."
sudo usermod -aG docker ${USER}
sudo service docker restart
su - ${USER}
echo "Docker install done!"
echo "Installing docker-compose"
sudo curl -L "https://github.com/docker/compose/releases/download/1.24.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
echo "Installation completed!"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment