I followed the instructions Ubuntu | Docker Docs on a new virtual machine.
Next in step 3 Part 1: Containerize an application | Docker Docs after running the command
docker build -t getting-started .
an error is issued
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Information about the environment:
Ubuntu 22.04
avauser@web:~/getting-started-app$ docker compose version
Docker Compose version v2.23.0-desktop.1
avauser@web:~/getting-started-app$ docker --version
Docker version 24.0.7, build afdd53b
avauser@web:~/getting-started-app$ docker version
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
Client: Docker Engine - Community
Cloud integration: v1.0.35+desktop.5
Version: 24.0.7
API version: 1.43
Go version: go1.20.10
Git commit: afdd53b
Built: Thu Oct 26 09:07:41 2023
OS/Arch: linux/amd64
Context: default
Similar topics are not suitable for these reasons:
1. https://forums.docker.com/t/error-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/115408
Not suitable, since Docker Engine is considered there
2. https://forums.docker.com/t/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/130002
Not suitable, since Docker Engine is considered there
3. https://forums.docker.com/t/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/57372
Not suitable, since it runs under Windows
4. https://forums.docker.com/t/docker-cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running/79657
Not suitable, as it runs under DockerHub
5. https://forums.docker.com/t/cannot-connect-to-the-docker-daemon-at-unix-var-run-docker-sock-is-the-docker-daemon-running-2-0/64828/5
Not suitable, since docker-compose was installed