I am trying to run Docker commands without sudo user, but they are giving me below error:
I following the steps provided online:
Created the docker group --> sudo groupadd docker
Add user to the docker group --> sudo usermod -aG docker $USER
restarted VM --> newgrp docker
sudo setfacl -m user:$USER:rw /var/run/docker.sock
restarted docker:
sudo systemctl daemon-reload`
sudo systemctl restart docker
I also tried modifying the visudo file and added my user privileges as below:
sudo visudo
anand ALL=(ALL:ALL) ALL
anand ALL=(ALL) NOPASSWD: ALL
I even tried changing the owner of my /var/run/docker.sock file to my user. It was with root initially
srw-rw---- 1 root docker 0 Aug 2 12:37 /var/run/docker.sock
I changed owner to below:
srw-rw---- 1 anand anand 0 Aug 2 12:37 /var/run/docker.sock
Finally none of the options seem to work. Kindly suggest some options to fix this issue.