Docker installation Issues and resolution

If you are having docker command issue most likely you have not performed docker post installation steps. Check the steps here

Following steps needs to be taken in order for the docker to work

#create a docker group 'docker' - most of the install creates this by default
sudo groupadd docker
#add your user to the docker group
sudo usermod -aG docker $User
#activate the docker group
newgrp docker 

Now you should be able to build docker with the user that you added to the group.

This is one of the Issue that you will encounter if you have not done the docker post installation steps.

Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock

Check the following command to ensure that you the user that you are using is in the group

list group ids of current user: id --groups
show uid:gid of docker.sock: stat /var/run/docker.sock --format '%u:%g

If the user’s did is not same as the docker then, you will need the user to add to the gid.

If you have not followed the post-install steps, follow the test in the following post-install reference.

Proxy Configuration:

If you are being a firewall, you will need to configure proxy setting.

You need to create:

.docker/config.jason in your home directory of the user that you are doing the docker build.

{
 "proxies":
 {
   "default":
   {
     "httpProxy": "http://192.168.1.12:3128",
     "httpsProxy": "http://192.168.1.12:3128",
     "noProxy": "*.test.example.com,.example2.com,127.0.0.0/8"
   }
 }
}

References: