Last active
December 2, 2018 11:34
-
-
Save szepnapot/385f026c076f791d85722dcf549e66d4 to your computer and use it in GitHub Desktop.
How To Install and Use Docker on Ubuntu 18.04
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 | |
# check for root first | |
if [ "$EUID" -ne 0 ] | |
then echo "Please run as root" | |
exit | |
fi | |
# update local packages | |
apt update | |
# let apt use packages over HTTPS | |
apt install apt-transport-https ca-certificates curl software-properties-common -yq | |
# add the GPG key for the official Docker repository | |
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add - | |
# add the Docker repository to APT sources | |
add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" -y | |
# pick up changes | |
apt update -yq | |
# double check that we not use ubuntu's defult repossitory | |
apt-cache policy docker-ce | |
# install Docker | |
apt install docker-ce -yq | |
# check service | |
systemctl status docker | |
usermod -aG docker ${USER} | |
id -nG | |
docker |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment