Last active
May 25, 2018 15:02
-
-
Save cbkmephisto/a673d4a38238bdd23aa219dca32176f6 to your computer and use it in GitHub Desktop.
Shell script to install docker on ubuntu
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 | |
sudo bash -c " | |
# Update the apt package index: | |
apt-get update | |
# Install packages to allow apt to use a repository over HTTPS: | |
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 | apt-key add - | |
add-apt-repository \ | |
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \ | |
$(lsb_release -cs) \ | |
stable" | |
# INSTALL DOCKER CE | |
apt-get update | |
apt-get install -y docker-ce | |
# Manage Docker as a non-root user | |
groupadd docker | |
" | |
sudo usermod -aG docker $USER | |
echo " | |
Please log out and log back in so that your group membership is re-evaluated. | |
Verify that you can run docker commands without sudo. | |
docker run hello-world | |
" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment