Skip to content

Instantly share code, notes, and snippets.

@akhildevelops
Last active November 17, 2018 11:58
Show Gist options
  • Save akhildevelops/b6bad4b3aefe665d961b9a56ffab8d0e to your computer and use it in GitHub Desktop.
Save akhildevelops/b6bad4b3aefe665d961b9a56ffab8d0e to your computer and use it in GitHub Desktop.
Script to Download Docker at single shot for ubuntu
#!/bin/bash
# Update the Repositories
sudo apt-get update
# Remove any old / unwanted / exisitng doncker installation
sudo apt-get -y remove docker docker-engine docker.io
# Remove any old Containers / Images
# sudo rm -rf /var/lib/docker
# Install necessary packages in debian/ubuntu
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
# Adds the Security Key File
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
# Adding repository link
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
# Update the Repositories
sudo apt-get update
# Install docker
sudo apt-get -y install docker-ce
# create docker group
#sudo groupadd docker
# Add current user to the group
sudo usermod -aG docker $USER
# After installing exit the shell and login once again for the changes to take efect,
@akhildevelops
Copy link
Author

Credits to docker documentation. Will work on any ubuntu based OS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment