Virtual Geek

Tales from real IT system administrators world and non-production environment

docker: Got permission denied while trying to connect to the Docker daemon socket

Ansible AWX installation error docker-compose run --rm --service-ports task awx-manage migrate --no-input
Ansible AWX installation error Cannot have both the docker-py and docker python modules
Install Ansible AWX Tower on Ubuntu Linux

Above are few errors I had encounted while installing and setting up ansible awx, Additionally below is one more issue I face recently when tried from not root user, It is not more likely issue related to Anisble AWX tower configuration but it is more likely docker. 

vjanvi@ansible-awx:~$ docker ps
Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/json: dial unix /var/run/docker.sock: connect: permission denied

docker ps got permission denied while trying to connect to the docker daemon socket at unix var run docker.sock containers json dial ansible awx.png

I had missed one of the step. To resolve it make sure your user account has docker group access and it is created. In the last restart your computer (Try with logoff and login if doesn't work reboot OS).

sudo groupadd docker
sudo usermod -aG docker $USER 
# sudo usermod -aG docker ${$USER}

ansible awx docker sudo groupadd docker sudo usermod -aG docker $USER reboot docker.sock permission denied container ansible tower.png

Once login again try the docker commands all will look good.

vjanvi@ansible-awx:~$ docker ps

ansible docker continer ansible awx awx_web awx_task awx_postgres awx_redis image ansible awx tower configuration containerization automation permission denied.png

There is another solution instead of creating group you can run this command sudo chmod 666 /var/run/docker.sock.

Useful Articles
How to install Docker on Linux
 How to install Ansible on Linux for vSphere configuration
Getting started Ansible AWX tower for IT automation run first playbook
Ansible for VMwary Using vmware_vm_inventory dynamic inventory plugin
Ansible selectattr The error was TemplateRuntimeError no test named 'equalto'
ansible create an array with set_fact
Ansible get information from esxi advanced settings nested dictionary with unique keynames

Go Back


Blog Search

Page Views


Follow me on Blogarama