Docker Installation on CentOS 7 with Installation Script

The easiest way to install docker with installation script. Below is the script url. Make sure the user should have sudo privileges.

https://get.docker.com/

Execute the below two commands to install docker.

$ curl -fsSL get.docker.com -o get-docker.sh
$ sh get-docker.sh

[centos@docker-server ~]$ curl -fsSL get.docker.com -o get-docker.sh
[centos@docker-server ~]$ sh get-docker.sh
# Executing docker install script, commit: fc04d2c
+ sudo -E sh -c 'yum install -y -q yum-utils'
Package yum-utils-1.1.31-42.el7.noarch already installed and latest version
+ sudo -E sh -c 'yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo'
Loaded plugins: fastestmirror
adding repo from: https://download.docker.com/linux/centos/docker-ce.repo
grabbing file https://download.docker.com/linux/centos/docker-ce.repo to /etc/yum.repos.d/docker-ce.repo
repo saved to /etc/yum.repos.d/docker-ce.repo
+ '[' edge '!=' stable ']'
+ sudo -E sh -c 'yum-config-manager --enable docker-ce-edge'
Loaded plugins: fastestmirror
............................................
...............................................
...................................................

After completed, execute below command to run docker commands as non root.

sudo usermod -aG docker your-username

[centos@docker-server ~]$ sudo usermod -aG docker centos

Start docker 

[centos@docker-server ~]$ sudo systemctl start docker 

Check version of Docker

[centos@docker-server ~]$ docker --version 
Docker version 18.02.0-ce, build fc4de44
[centos@docker-server ~]$ 

To uninstall docker, execute below command

[centos@docker-server ~]$ sudo yum remove docker-ce

 

Advertisements

Post your Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s