How to fix permission with Docker daemon


I have recently tried to follow the example from the documentation to create a TensorFlow NGC container and run a command to get the container’s TensorFlow build information. However, despite repeating the exact same steps as in the documentation, I encountered the following error:

ubuntu@instance-ip:~$ docker run --gpus all -it python -c "import tensorflow as tf ; sys_details = tf.sysconfig.get_build_info() ; print(sys_details)"
docker: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/containers/create": dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

I’m currently testing on-demand cloud instances and have added the ubuntu user to the Docker group using: sudo adduser "$(id -un)" docker. I have also tried to reboot the instance.

Thank you in advance for your help!

Please provide the output of id. Your output should look like:

ubuntu@146-235-215-51:~$ id
uid=1000(ubuntu) gid=1000(ubuntu) groups=1000(ubuntu),100(users),118(admin),999(docker)