Skip to content

Instantly share code, notes, and snippets.

@HarshTrivedi
Created November 29, 2018 21:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save HarshTrivedi/8bc4845870df73980ff940c3d29ca5f6 to your computer and use it in GitHub Desktop.
Save HarshTrivedi/8bc4845870df73980ff940c3d29ca5f6 to your computer and use it in GitHub Desktop.
# Source Link: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
sudo apt update
sudo apt install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
sudo apt update
apt-cache policy docker-ce
# Should see something like (may be with different version number):
# docker-ce:
# Installed: (none)
# Candidate: 18.03.1~ce~3-0~ubuntu
# Version table:
# 18.03.1~ce~3-0~ubuntu 500
# 500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
sudo apt install docker-ce
# Check that it's running:
sudo systemctl status docker
# Output should look like:
# docker.service - Docker Application Container Engine
# Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
# Active: active (running) since Thu 2018-07-05 15:08:39 UTC; 2min 55s ago
# Docs: https://docs.docker.com
# Main PID: 10096 (dockerd)
# Tasks: 16
# CGroup: /system.slice/docker.service
# ├─10096 /usr/bin/dockerd -H fd://
# └─10113 docker-containerd --config /var/run/docker/containerd/contain
sudo usermod -aG docker ${USER}
su - ${USER}
id -nG
# Output should be like:
# junkang sudo docker
# Lastly, please add me to the group aswell:
sudo usermod -aG docker hjtrivedi
# Make sure docker works:
docker -v
# Docker version 18.09.0, build 4d60db4
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment