I tried to install a software with Docker while building an image and I get.
docker: Cannot connect to the Docker daemon at unix:///var/run/docker.sock.
Is the
your problem is not with the Docker command, as it says in the error message your docker daemon is not running, or because of some configuration problem you can not connect to it.
Did you just install Docker? Did you do all the steps in the Installation Guide?
You can test your docker installation with docker run hello-world
or sudo docker run hello-world
If it only works with sudo it's because you didn't configure docker for your user, see: https://docs.docker.com/install/linux/linux-postinstall/