How To Use Docker

This post include information of installation and simple useage of docker.

Install docker

For Ubuntu

Docker needs Ubuntu system which version is higher then 3.10, so first check that:

uname -r

Using shell sciprt to install:

wget -qO- https://get.docker.com/ | sh

For macOS

Using Homebrew install Docker:

brew cask install docker

For All Linux

$ #[sudo apt-get remove docker docker-engine docker.io]

$ sudo apt-get update

$ sudo apt-get install \
    apt-transport-https \
    ca-certificates \
    curl \
    software-properties-common

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

$ sudo apt-key fingerprint 0EBFCD88

result should be like this:

pub   4096R/0EBFCD88 2017-02-22
Key fingerprint = 9DC8 5822 9FC7 DD38 854A  E2D8 8D81 803C 0EBF CD88
uid                  Docker Release (CE deb) <docker@docker.com>
sub   4096R/F273FCD8 2017-02-22

if correct, then:

$ sudo add-apt-repository \
"deb [arch=amd64] https://    download.docker.com/linux/ubuntu \

$(lsb_release -cs) \
stable"

$ sudo apt-get update

$ sudo apt-get install docker-ce

# Test
$ sudo docker run hello-world

For other system see Docker install

Docker commands

All Commands with explanation here