Created
July 11, 2020 14:05
-
-
Save amitk/8e51076d357028425cdaba22b0c45d70 to your computer and use it in GitHub Desktop.
A way to install docker on a ubuntu system
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
# Uninstall Docker | |
sudo apt-get remove docker docker-engine docker-ce docker.io | |
# Update the apt package index | |
sudo apt-get update | |
# Allow apt to use a repository over HTTPS | |
sudo apt-get install \ | |
apt-transport-https \ | |
ca-certificates \ | |
curl \ | |
software-properties-common | |
# Add Docker’s official GPG key to apt | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | |
# Verify that you now have the Docker GPG key | |
sudo apt-key fingerprint 0EBFCD88 | |
# Add the Docker repository to apt | |
sudo add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# Re-Update the apt package index now that we have the Docker repositories added | |
sudo apt-get update | |
# Install a specific version of Docker | |
sudo apt-get install docker-ce=17.12.0~ce-0~ubuntu | |
# Make sure that the Docker group is already added | |
sudo groupadd docker | |
# Add your username to the Docker group | |
sudo usermod -aG docker $USER | |
# Log out and back in | |
# Test Docker with the version command and hello-world | |
docker version | |
docker run hello-world |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment