Traefik with Docker in Bitbucket Pipelines

I am running docker compose in Bitbucket Pipelines. In the compose file I have Traefik set up like this:

  traefik:
    image: traefik:v2.11
    container_name: traefik
    command:
      - "--log.level=DEBUG"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entryPoints.web.address=:80"
    ports:
      - "80:80"
      - "8080:8080"
    volumes:
      - "/var/run/docker.sock:/var/run/docker.sock:ro"

It works on my computer locally, however, I get the following error when running it in Bitbucket Pipelines:

level=error msg="Failed to retrieve information of the docker client and server host: permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied" providerName=docker
level=error msg="Provider connection error permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get \"http://%2Fvar%2Frun%2Fdocker.sock/v1.24/version\": dial unix /var/run/docker.sock: connect: permission denied, retrying in 556.184722ms" providerName=docker

It looks like the docker.sock is not available in Pipelines. Is it possible to use Traefik with Docker without using docker.sock? What else can I try?

Checking they make any kind of Docker API available for Traefik configuration discovery, via socket or TCP connection.

Thank you for the hint, the solution was indeed to pass docker as a tcp url to Traefik.

See the highlighted lines in the compose.yaml below.

traefik:
  image: traefik:v2.11
  container_name: traefik
  command:
    - "--log.level=DEBUG"
    - "--api.insecure=true"
    - "--providers.docker=true"
    - "--providers.docker.endpoint=tcp://host.docker.internal:2375"  # <-----
    - "--providers.docker.exposedbydefault=false"
    - "--entryPoints.web.address=:80"
  ports:
    - "80:80"
    - "8080:8080"
  extra_hosts:
    - "host.docker.internal:$BITBUCKET_DOCKER_HOST_INTERNAL"  # <-----