How to Install Docker in Linux?

How to Install Docker in Linux?
 
Note - You should install Docker using root or with sudo access.
 
Install Docker on Ubantu 
# apt-get update
# apt-get install -y docker.io
# service docker.io start
 
Install Docker on Redhar / Centos
# yum update
# yum install -y docker.io
# systemctl start docker.service
 
How to verify the version of docker?
# docker -v
# docker version
 
How to know docker running?
# service docker.io status (Ubantu)
# systemctl status docker.service (Redhat)
 
How to check details of Docker clients, deamon, containers, images, drivers, etc
# docker info
 
How to update Docker version?
==============================================
# wget -q0- https://get.docker.com/gpg | apt-key add -
# echo deb http://get.docker.com/ubantu docker main > /etc/apt/sources.list.d/docker.list
# apt-get update
# apt-get install lxc-docker
# docker version
 
Configuration post docker installation:
Adding Users to the Docker Group for non-root user
==============================================
# docker run -it ubuntu /bin/bash (as a non-root)
[ permission denied]
# cat /etc/group
# sudo gpasswd -a username docker
# cat /etc/group
# docker run -it ubuntu /bin/bash (as a non-root)
# logout
# login username
Rate this item
(0 votes)
Rajesh Kumar

.

Total, Over 12 years of extensive experience in the Software Configuration Management domain having depth knowledge of DevOps, Continuous Integration and Delivery, Configuration Management, Build and Installer, Release Management and Application Management.

What corporate management say about us?

Rajesh is very good trainer with very good technical knowledge. He was able to resolve our queries effectively with the proper live example.The session was very helpful and interactive. Overall satisfied with the training.<br />

Rahul Ruhela
https://in.linkedin.com/in/rahul-singh-34718a25
Sep 02, 2016

Authors

Login