Skip to content

Docker CE installation on Centos Box

Step-1: EPEL release Repo

$ sudo yum install -y epel-release

 

Step-2: Remove Older Docker version if installed

$ sudo yum remove docker 
                  docker-common 
                  docker-selinux 
                  docker-engine

 

Step-3: SET UP THE REPOSITORY

$ sudo yum install -y yum-utils 
  device-mapper-persistent-data 
  lvm2

Step-4: Set up the stable repository

$ sudo yum-config-manager 
    --add-repo 
    https://download.docker.com/linux/centos/docker-ce.repo

 

Step-5: INSTALL DOCKER CE

$ sudo yum install docker-ce

 

Step-6: Start Docker

$ sudo systemctl start docker

 

Step-7: Uninstall Docker CE

$ sudo yum remove docker-ce

 

Step-8: Removing Images, containers, volumes, or customized configuration files

$ sudo rm -rf /var/lib/docker

 

Step-9: Manage Docker as a non-root user

# Create the docker group.
$ sudo groupadd docker

# Add your user to the docker group
$ sudo usermod -aG docker $USER

 

Step-10: Permission Denied Error

# WARNING: Error loading config file: /home/user/.docker/config.json -stat /home/user/.docker/config.json: permission denied

$ sudo chown "$USER":"$USER" /home/"$USER"/.docker -R
$ sudo chmod g+rwx "/home/$USER/.docker" -R

Step-11: Permission Denied – Connect – Daemon Socket


docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http:///var/run/docker.sock/v1.26/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

<span class="">$ sudo usermod -a -G docker </span><span class="kw4">$USER</span>

 

Step-12: Configure Docker to start on boot

$ sudo systemctl enable docker

 

Shashi View All

-== Superman ==-

Leave a Reply

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 )

Connecting to %s

%d bloggers like this: