Facing error when I try to build and push image from azure pipleline to docker hub

Facing error when I try to build and push image to docker hub.
##[error]time=“2023-06-19T16:18:07Z” level=error msg=“failed to dial gRPC: cannot connect to the Docker daemon. Is ‘docker daemon’ running on this host?: dial unix /var/run/docker.sock: connect: no such file or directory”
##[error]context canceled
##[error]The process ‘/home/vscode/azure-pipelines/_work/_tool/docker-stable/17.9.0-ce/x64/docker’ failed with exit code 1

I having a self hosted host in github.
this is my current code

  - task: Docker@2
    displayName : Login to Docker Hub
        command: login
        containerRegistry: Docker_Hub #fypproject #dockerRegistryServiceConnection1 #

  - task: DockerInstaller@0
    displayName: Docker Installer
        dockerVersion: 17.09.0-ce
        releaseType: stable

  - script: |
      sudo apt-get update
      sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
    displayName: install docker engine
  - task: Docker@2
    displayName: Build and Push
        command: buildAndPush
        repository:   vampurr/newimage # username/contosoRepository for DockerHub
        Dockerfile: /workspaces/FYP_Project/.devcontainer/Dockerfile