Last active
November 26, 2023 14:10
-
-
Save tieutantan/b88a9f34f3677f4ddaaa6234921607f9 to your computer and use it in GitHub Desktop.
Script To Install Newest Docker + Docker Compose On Ubuntu 22
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
#!/bin/bash | |
# Update the package index | |
sudo apt-get update | |
# Install packages to allow apt to use a repository over HTTPS | |
sudo apt-get install -y \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
# Add Docker’s official GPG key | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# Set up the stable repository | |
sudo add-apt-repository \ | |
"deb [arch=$(dpkg --print-architecture)] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# Update the package index again | |
sudo apt-get update | |
# Install the latest version of Docker Engine and containerd | |
sudo apt-get install -y docker-ce docker-ce-cli containerd.io | |
# Install Docker Compose | |
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose | |
sudo chmod +x /usr/local/bin/docker-compose | |
sudo chmod 777 /var/run/docker.sock | |
sudo systemctl enable docker # enable docker service on boot | |
# Print Docker and Docker Compose version | |
docker --version | |
docker-compose --version |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment