Last active
January 1, 2023 14:13
-
-
Save tegarimansyah/229676bb91d2f189684a6ce70d6dacbf to your computer and use it in GitHub Desktop.
Set Up Docker for Ubuntu Linux 18.04 or newer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set -ex | |
# Preparation | |
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 - | |
source /etc/lsb-release # Get current version codename | |
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $DISTRIB_CODENAME stable" | |
sudo apt update | |
# Install and check | |
sudo apt install -y docker-ce | |
# Docker without sudo | |
sudo usermod -aG docker ${USER} | |
# Docker Compose | |
sudo curl -L https://github.com/docker/compose/releases/download/2.14.2/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
# Check Version | |
echo "Installation Done, checking version.." | |
echo "=======================================" | |
echo | |
docker -v | |
docker-compose --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How to use: