If you are getting and error running docker command as a non-root user,
Code:
dev@ubuntu:~$ docker run hello-world
Error:
Code:
docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Post http://%2Fvar%2Frun%2Fdocker.sock/v1.40/containers/create: dial unix /var/run/docker.sock: connect: permission denied.
See 'docker run --help'.

Solution: Provide group permission and docker.sock file permission.

Step #1: Create user-group docker and add hte user to it


Code:
sudo groupadd docker
# Example adding user "dev" to the group "docker"
sudo usermod -aG docker dev

Step #2: Provide read write permission to docker.sock file


The below will fix error, "docker: Got permission denied while trying to connect to the Docker daemon socket"
Code:
sudo chmod 666 /var/run/docker.sock
Official documentation on post-install tasks, https://docs.docker.com/engine/install/l...stinstall/