Quick Tip: Install Docker on Ubuntu 18.04

#!/bin/bash +xe
echo "Run me as 'sudo'!"
echo "Installing Docker (CE) on Ubuntu 18.04"
lsb_release -r

apt update -y
apt-get remove -y docker docker-engine docker.io containerd runc
apt-get install -y apt-transport-https ca-certificates curl gnupg-agent software-properties-common

curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

apt-key fingerprint 0EBFCD88

add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"

apt-get update -y
apt-get install -y docker-ce docker-ce-cli containerd.io

usermod -aG docker $(whoami)

which docker
docker --version

docker container run hello-world

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.