First get the container ID:
docker ps
(First column is for container ID)
Use the container ID to run:
docker inspect <container id> | grep "IPAddress"
In another terminal window:
docker run \
--rm \
--name sonar-cli \
--platform linux/amd64 \
-e SONAR_HOST_URL="{enter ip of docker container running sonarqube" \
-e SONAR_LOGIN="{enter token here}" \
-v "{local directory}:/usr/src" \
nancom/sonar-scanner-m1 \
-Dsonar.projectKey="{project name or key}" \
-Dsonar.verbose=true